• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

open_basedir restriction !?!?

J

JoaoCorreia

Guest
[client 195.23.115.68] PHP Warning: move_uploaded_file(): open_basedir restriction in effect. File(/home/httpd/vhosts/star-wear.net/httpdocs/images/test.jpg) is not within the allowed path(s): (/var/www/vhosts/star-wear.net/httpdocs:/tmp:/var/www/vhosts/star-wear.net/httpdocs/images) in /var/www/vhosts/star-wear.net/httpdocs/admin/includes/classes/upload.php on line 94, referer: http://www.star-wear.net/admin/categories.php?cPath=25_27&pID=169&action=update_product

I added the vhost.conf but its not working anyway. I still get an error and it doesnt upload the file.

Any tips
Joao Correia
 
No ideas, but have similar problems with the open_basedir.

I have a post running as well, just posted it a lil later. Also have one on the mambo forums as I ran into this with mambo.
 
Have a similar Problem with open_basedir.
Don't know how to figure it out.

Warning: %v%v() [function.%v]: open_basedir restriction in effect. File(/usr/share/php5/countries_list.php) is not within the allowed path(s): (/srv/www/vhosts/aaaa.com/httpdocs:/tmp) in /srv/www/vhosts/aaaa.com/httpdocs/init.php on line 257

in /etc/php5/apache/php.ini i have following:
;open_basedir =

In the http.include for that domain following:

<IfModule mod_php5.c>
php_admin_flag engine on
php_admin_flag safe_mode off
php_admin_value open_basedir "/srv/www/vhosts/aaaa.com/httpdocs:/tmp"

Does somebody know, whats wrong ?
 
My 'not so educated' guess would be that PHP is fu**ing up the path. With us the log says it's trying to load /include.php (well the filename is actually different but appearantly it tries to locate it in the root (/) which isn't ok ofcourse).

If PHP really thinks it should look in that path first open_basedir will conflict indeed. I just removed all settings for open_basedir (in which case it's unset and thus not used) and then it works fine, even though the file is in a whole other location (in some dir under the vhost stuff where the rest of the website is as well and that path actually _IS_ (well was by now :)) in the open_basedir setting...
 
Originally posted by freaky
My 'not so educated' guess would be that PHP is fu**ing up the path. With us the log says it's trying to load /include.php (well the filename is actually different but appearantly it tries to locate it in the root (/) which isn't ok ofcourse).

If PHP really thinks it should look in that path first open_basedir will conflict indeed. I just removed all settings for open_basedir (in which case it's unset and thus not used) and then it works fine, even though the file is in a whole other location (in some dir under the vhost stuff where the rest of the website is as well and that path actually _IS_ (well was by now :)) in the open_basedir setting...

could you explain what i should do in my case ?

Remove the whole entry in http.include with open_basedir ?

th@nks
 
@JoaoCorreia: have you checked the folder permissions? (chmod/chown)
 
I had to setup a vhost.conf. However, note that the PHP values were NOT overriden unless I put them in a directory container like so:
<Directory var/www/vhosts/domain/httpdocs>
php_admin_value open_basedir =
php_admin_flag safe_mode = 0
</Directory>

Hope this helps
 
Back
Top