1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

move_uploaded_file(): open_basedir restriction(NOT newbie problem)

Discussion in 'Plesk for Linux - 8.x and Older' started by crops, Jan 23, 2006.

  1. crops

    crops Guest


    i get the old error, move_uploaded_file(): open_basedir restriction in effect where on one of my domains i have done everything that is needed to ensure that my vhosts.conf file works correctly e.g.

    <Directory /home/httpd/vhosts/DOMAIN/httpdocs>
    php_admin_value open_basedir /home/httpd/vhosts/DOMAIN/httpdocs:/tmp:/usr/share/pear
    php_admin_flag safe_mode 0

    which is something thats created automatically with the creation of a domain with a shell script.

    i've tried to edited again,manually and reconfigured apache again(with /usr/local/psa/admin/bin/websrvmng -u --vhost-name=DOMAIN) and restarted but no problem. My http.inlcude seems to be fine and has a reference to my .conf file

    i have an .htaccess on the httpdocs directory that defines some directories dor inclusion and i have tried everything that is programmer possible to get a simple file upload to work ( ifeel stupid posting it here, but hope that someone has come accross smt similar)

    The weird thing is that i have the FCK Editor that has a functionalitty to upload images and that doesnt have a problem at all.(i've tweacked it to create a thumbnail at the same time, which works fine) and I also used the umask option to get the permissions for the file fixed before moving it from the tmp folder to my folder, but nothing....

    these settings worked for all my sites until now (they still work on other sites...)

    does anyone has any suggestions?

    much appreciated

    DRYALLS Basic Pleskian

    Jan 23, 2006
    Likes Received:
    You've probably checked these, but:

    have you run a phpinfo(); to make sure that these open_basedir restrictions are actually being used.

    Is the /tmp folder readable/writeable by PHP?

    Hope you figure this out soon, because it sounds as though I might bump into it real soon. :(
  3. crops

    crops Guest

    done all these checks

    Hi there,

    yes checked out if this directory is W/R from php and there is no problem there. If it wasnt i would be able to upload images from my editor either which uploads files to that directory as well...

    ive searched all forums but no one seems to have a similar problem... I know what i'm doing and i've expirienced these kind of errors before. Safe mode is off and the httpdoc directory is on the safe list.....
  4. crops

    crops Guest


    Hi again,

    so basically i knew that it was something stupid. To share my finding with others, as far as it concerns the open_base_dir restriction EVEN when you have done what the others have posted (eg. vhost.conf file and reconfiguration plus restarting the apache) you need to remember that whatever you do your script will have to refer to the file with a relative path from the file executing the function

    for e.g. i was trying to use the move_uploaded_file method and i was giving the bew file the directory path eg. /httpdocs/photos/file.jpg which will give you that error even if do have all the settings correct (I'm usre you understand why..). so basically if gave the script a relative path e.g. ../photos/ (realtive to the script ) then no problem...

    hope that info helps someone