• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

open_basedir problem with Plesk 8.0.x and PHP5

ryanz

Basic Pleskian
Hi,

It seems if tried everything to change or disable open_basedir for a domain but for some or other reason it's not working. Even the Plesk KB http://kb.swsoft.com/article_41_432_en.html didn't help.

The system is FC4, PHP5, Plesk 8.0.1

Safe_mode is Off for this doamin.

I created a vhost.conf file in /var/www/vhots/domain.com/conf with many variations on the content, some examples include:

<Directory /var/www/vhosts/domain.com/httpdocs>
<IfModule sapi_apache2.c>
php_admin_flag engine on
php_admin_flag safe_mode off
php_admin_value open_basedir "none"
</IfModule>
<IfModule mod_php5.c>
php_admin_flag engine on
php_admin_flag safe_mode off
php_admin_value open_basedir "none"
</IfModule>
</Directory>

and

<Directory /var/www/vhosts/domain.com/httpdocs>
<IfModule sapi_apache2.c>
php_admin_flag engine on
php_admin_flag safe_mode off
php_admin_value open_basedir none
</IfModule>
<IfModule mod_php5.c>
php_admin_flag engine on
php_admin_flag safe_mode off
php_admin_value open_basedir none
</IfModule>
</Directory>

and

<Directory /var/www/vhosts/domain.com/httpdocs>
php_admin_flag engine on
php_admin_value open_basedir none
</Directory>

and

<Directory /var/www/vhosts/domain.com/httpdocs>
php_admin_flag engine on
php_admin_value open_basedir "/var/www/vhosts/domain.com/httpdocs:/tmp:/var/www/vhosts/domain.com/httpdocs/folder"
</Directory>

Then doing

/usr/local/psa/admin/websrvmngr --reconfigure-vhost --vhost-name=DOMAIN

and also this variation

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

then

service httpd restart

But when I look at phpinfo for the domain the open_basedir remains as
/var/www/vhosts/domain.com/httpdocs:/tmp

Any other advice wiil be appreciated.
 
vhost.conf is:

<Directory /var/www/vhosts/domain.com/httpdocs>
php_admin_value open_basedir none
</Directory>

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


service httpd restart
 
Hi,

I've tried variations of what you suggested:

<Directory /var/www/vhosts/domain.com/httpdocs>
php_admin_flag engine on
php_admin_value open_basedir none
</Directory>

and

<Directory /var/www/vhosts/domain.com/httpdocs>
php_admin_value open_basedir none
</Directory>

then

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

then

service httpd restart

Would it need a server reboot?
 
I changed my /etc/php.ini to open_basedir none as well.

You don't need to reboot.
 
What application are you using that requires open basedir off?

There is one that comes to mind that requires open_basedir be "/" but I don't know why. That isn't the correct syntax.
 
Thanks for more replies and suggestions.

It's a custom script/appl on one of our client domains.
I've already suggested that the coder should be able to fix their problem by changing the script to work with the standard Plesk open_basedir values.

I've tried changing /etc/php.ini to open_basedir = none with a restart of httpd but phpinfo still remains at the old value.

But when I look at phpinfo for the domain the open_basedir remains as
/var/www/vhosts/domain.com/httpdocs:/tmp with the global value as "no value"

It seems something is not updated and this is driving me crazy.
Is it due to php 5?
 
That is how it is supposed to look.

The only way that you will know whether it is working or not is to have your coder try his scripts again.

You will only run into an open basedir restriction is in effect message when you are performing irregular coding practices such as accessing directories "outside" of the base directory path.

That's why this option is there. To protect you from mess ups.:)
 
That also reminds me. He could be using server arrays that are global in nature. This would cause a problem like this too.

I tripped up my configuration one day when I assigned a variable outside the working directory and then called it into another class from a different location. This can easily be done when working on scripts that require SSL but your configuration is not set to same directory SSL.

Yes it works but the open base directory thing will stop it every time as a security precaution.

The only other option you have is turning it off globally but if it is a shared system I would think twice before disarming it.
 
The problem seems to be solved by the programmer who updated his code to suit php5 and the open_basedir restrictions.

Thanks for the suggestions.
 
Originally posted by maxrisc
vhost.conf is:

<Directory /var/www/vhosts/domain.com/httpdocs>
php_admin_value open_basedir none
</Directory>

On a side note, this helped me permanently override the open_basedir on my server. It was getting annoying having the httpd.include settings overwritten each time I modified the website or added a subdomain. Thanks!
 
Back
Top