• 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 problem NOT fixed with safe mode on?

W

webcanada

Guest
Hi there,

I thought that by disabling safe mode, that would allow that domain to open scripts in other domain's folders, but this does not seem to be the case.

My domain has the safe mode checkbox UNCHECKED, and I still get the "open_basedir restriction in effect" error when trying to access a folder outside of this domain.

Any ideas?

Thanks!
 
Yes, in fact, I had turned off safe mode weeks ago. Since then not only has apache been restarted, but so has the whole computer. :(
 
Have you mucked with /etc/php.ini?

Just asking.. ;)

Have you tried a vhost.conf directive?
 
I haven't tried anything outside of unchecking safe mode.

Is there something else I should try? Or should that do it?
 
PHP safe_mode and open_basedir are separate settings. You cannot alter the open_basedir path through Plesk's web interface, but you can create a vhost.conf file in a domain's conf dir to override the open_basedir path.

There's a Knowledge Base article on this. There are also many posts in the forums on open_basedir.
 
I had the same problem. The following assumes yourmainname.com as the domain

Ssh to cd /var/www/vhosts/yourdomainname.com/conf
Contents of file vhost.conf should be ------ start here this line not included
<Directory /var/www/vhosts/yourdomainname.com/httpdocs>
php_admin_flag engine on
php_admin_value open_basedir none
</Directory>
------ end here this line not included

and then run

/usr/local/psa/admin/sbin/websrvmng -v -a

if you are using ssl access for your users you will also need the same information in the file
vhost_ssl.conf
 
For security I recommend to add the dirs you want the code to access explicitly instead of just setting the open_basedir path to 'none'.
 
I have the same problem. But its easy to fix!

In the php.ini just configure the upload temporary folder config to: /tmp

set to enable the upload and disable the safe mode.

To find the php.ini type:

find / -name php.ini

use vi or any other you want to edit, save and restart the service using your plesk control panel.
 
Back
Top