Support » Networking WordPress » Header Image can't get from media library

  • 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?

Viewing 15 replies - 1 through 15 (of 21 total)
  • 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!!

    It’s Multisite, not WPMU 🙂

    What theme is this?

    @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.

    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 ?

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

    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?

    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?)

    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

    *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?

    checked. all sites has same setting value.

    advice to resolve?

    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?

    It’s not mapped domain.

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

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

    ALL.

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

Viewing 15 replies - 1 through 15 (of 21 total)
  • The topic ‘Header Image can't get from media library’ is closed to new replies.