Activities

January 2010
M T W T F S S
« Dec   Feb »
 123
45678910
11121314151617
18192021222324
25262728293031

“open_basedir restriction in effect” on Plesk

Question,

I can’t upload images to the web even that folder was given full access to the webserver. Server is Centos5 with Plesk loaded

My error messages should like this,

Wed Jan 27 08:55:57 2010] [error] [client 122.166.23.96] PHP Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/var/www/vhosts/mydomain.com/httpdocs/PrdImages/1517face.gif) is not within the allowed path(s): (/var/www/vhosts/mydomain.com/httpdocs:/tmp)

Solution,

1. create a conf. file on /var/www/vhosts/mydomain.com/conf/vhost.conf and added the following entries on it.



php_admin_flag engine on
php_admin_flag safe_mode off
php_admin_value open_basedir “none”


php_admin_flag engine on
php_admin_flag safe_mode off
php_admin_value open_basedir “none”

then include this file entry on domain.conf file

vi  /var/www/vhosts/mydomain.com/conf/httpd.include

then added the following entry at the end of the file inside the virtualhost entry.

 Include /var/www/vhosts/mydomain.com/conf/vhost.conf

then, restart apache . I do also disable the running php on safe mode ( webhosting settings) from Plesk control panel for the domain.
[root@mydomain.com ~]# vi /var/www/vhosts/mydomain.com/conf/httpd.include
[root@mydomain.com ~]# vi /var/www/vhosts/mydomain.com/conf/vhost.conf
[root@mydomain.com ~]# /usr/local/psa/admin/sbin/websrvmng -a -v
[root@mydomain.com ~]# service httpd configtest
Syntax OK
[root@mydomain.com ~]# service httpd restart
Stopping httpd: [ OK ]
Starting httpd: [ OK ]

After the Apache restart, check the php variables should same as shown below,

open_basedir    no value    no value
safe_mode   Off Off

Updates :

There is another easiest way, we can do it easily from Plesk control panel itself. Go through the menu Hosting services –> Subscriptions–> mydomain.com –> Website and Domains –> Find the option” show “Advanced Operations” at the bottom of the window.

-njoy

4 comments to “open_basedir restriction in effect” on Plesk

Leave a Reply

  

  

  

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>