WordPress.org

Ready to get started?Download WordPress

Forums

Header Image can't get from media library (22 posts)

  1. shneoh
    Member
    Posted 1 year ago #

    I just setup my WPMU.

    When I try to change the theme header image to an image from media library, it shows an empty image in next step and tons of error message as follow:

    Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/) is not within the allowed path(s): (/home/antzblog/:/tmp:/var/tmp:/usr/local/lib/php/) in /home/antzblog/domains/antzblog.com/public_html/wp-includes/functions.php on line 1337
    
    Warning: is_dir() [function.is-dir]: open_basedir restriction in effect. File(/) is not within the allowed path(s): (/home/antzblog/:/tmp:/var/tmp:/usr/local/lib/php/) in /home/antzblog/domains/antzblog.com/public_html/wp-includes/functions.php on line 1346
    
    Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/) is not within the allowed path(s): (/home/antzblog/:/tmp:/var/tmp:/usr/local/lib/php/) in /home/antzblog/domains/antzblog.com/public_html/wp-includes/functions.php on line 1662
    
    Warning: imagejpeg() [function.imagejpeg]: Unable to open '/.jpg' for writing: Permission denied in /home/antzblog/domains/antzblog.com/public_html/wp-includes/class-wp-image-editor.php on line 334

    Anything I can do to solve this problem?

  2. Kshitij
    Member
    Posted 1 year ago #

    hi ,

    you can try either of these options:
    Either include the directory (actually, the whole WP root) in the open_basedir variable,
    or set open_basedir to off (or no value) in php.ini

    let me know if problem still persists , HTH!!

  3. It's Multisite, not WPMU :)

    What theme is this?

  4. shneoh
    Member
    Posted 1 year ago #

    @Mika: Twenty Eleven

    @Kshitij, the situation is still persists. From the error, it seems that the file was trying to save in "/" ?

    I have tried other theme, it gives the same problem. As long as the custome image is uploaded, all working in perfect. Just occurs whenever I pick an image from Media Library, it will show an empty crop imange in the next step and then prompted this error after I continues to step 3.

  5. Kshitij
    Member
    Posted 1 year ago #

    I see, may I know the following answers ?

    1) Have you updated your php.ini file , with open_basedir = 0 or open_basedir = blank ?
    If not then please update your php.ini file with the followings

    safe_mode=Off
    open_basedir=Off

    2) Which server and OS you are using ?

    3) Does your script trying to access any file outside your httpdocs/htdocs/www folder ?

  6. Kshitij is right, the problem is in your server setup for PHP :/

  7. shneoh
    Member
    Posted 1 year ago #

    I have found the problem, but don't know how to fix.

    After changing the Open_BaseDir = Off, the header image crop feature can function on "most of the images" in media library. (Yet to find out which can't and their reasons.)

    But then, after confirmed on the cropped image, the page flows back to header settings and noted that the cropped file is just showing a broken image... When I back to check in Media Library, it shows perfect...

    After searching around and I found that:
    The location of the header setting captured is in:
    wp-include/uploads/site/2/1/cropped-12345.jpg.

    The actual location I found in ssh and shown in Media Library is in:
    wp-content/uploads/sites/2/2007/12/cropped-12345.jpg

    It seems that both are taking different images location, what can I do now?

  8. 2/1 ?

    Huh... if your image is in wp-content/uploads/sites/2/2007/12/cropped-12345.jpg then WP should not edit that at all.

    Go to wp-admin/network/sites.php and edit site #2 (hover and there will be an 'edit' link)

    Do you have anything set for:

    Upload Path
    Fileupload Realpath
    Fileupload URL

    If so, what?

    DO NOT CHANGE THESE SETTINGS AT THIS TIME. Very important (can you tell I've had to bail a lot of people out?)

  9. shneoh
    Member
    Posted 1 year ago #

    Can't find Fileupload Realpath and Fileupload URL...

    What I have similar (i guess) are: Both empty.
    Upload Path =
    Upload Url Path =

    ps: don't scare me... I have over 50 users/sites in my network... T.T

  10. *heh* Well if the warning made you think REAL hard and NOT edit anything, then good. Cause messing with those values in the settings page is dangerous.

    Do you have those settings in the options for Site 1? i.e. your main site?

  11. shneoh
    Member
    Posted 12 months ago #

    checked. all sites has same setting value.

    advice to resolve?

  12. checked. all sites has same setting value.

    So ... your MAIN site also doesn't have Fileupload settings, or are they blank?

    Hrm... I had a similar problem (running 3.6) and I had to change them to

    /home/USER/public_html/wp-content/uploads/

    and

    http://DOMAIN.TLD/wp-content/uploads/

    You could try setting this:

    Upload Path = wp-content/uploads/sites/NUMBER

    Though that really only NEEDS to be set if you're using something different (the default normally words).

    This isn't a mapped domain, is it?

  13. shneoh
    Member
    Posted 12 months ago #

    It's not mapped domain.

    Do I really need to set these settings?!
    There are over 50 member sites in my network! (cry)

  14. Are all your sites having the same problem or just one?

  15. shneoh
    Member
    Posted 11 months ago #

    ALL.

  16. Turn off all of your plugins. Espcially anything network activated or any MU plugins.

  17. shneoh
    Member
    Posted 11 months ago #

    tried. still the same.

  18. What's in your .htaccess?

  19. shneoh
    Member
    Posted 11 months ago #

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # add a trailing slash to /wp-admin
    RewriteRule ^wp-admin$ wp-admin/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
    RewriteRule ^(.*\.php)$ $1 [L]
    RewriteRule . index.php [L]
  20. The location of the header setting captured is in:
    wp-include/uploads/site/2/1/cropped-12345.jpg.

    Hold the phone.

    wp-include/uploads...

    Are you ABSOLUTELY sure that's the path? And not wp-content/uploads...

    If so, search your files AND your database for 'wp-include/' and see if anythign shows up.

  21. shneoh
    Member
    Posted 11 months ago #

    Noted a weird situation.

    I have configured the same WP-multisite on another domain which sits in the same server with same settings.

    Trying the same problem, but this domain is working well!
    I am wondering what's actually wrong here...

    Noticed in Network/Sites, the sites domains are showing the full path (eg: nelson.duaspace.com) but in my problem WPMU it shows only name (eg: nelson). Wondering this might be the problem came, but how to fix?

    A few questions:
    1. Can re-installation solve this issue?
    2. If re-install, would it affect my existing user data and files?

  22. The only reinstall to fix this would really be a reboot (start the whole site over).... which I doubt you want to do.

    Noticed in Network/Sites, the sites domains are showing the full path (eg: nelson.duaspace.com) but in my problem WPMU it shows only name (eg: nelson). Wondering this might be the problem came, but how to fix?

    You didn't edit those at /wp-admin/network/site-info.php?id=1 did you? (I'm not saying you SHOULD, I'm asking if you DID!)

Topic Closed

This topic has been closed to new replies.

About this Topic