• 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

PHP open_basedir (local) setting overwritten for vhosts

D

doughty

Guest
I've done a few hours of searching last night, and have not been success with any of the methods listed.

I need the local php setting (open_basedir) on $DOMAIN$ to be set as null, or even changed at all.

I am being virtually hosted on a CentOS running Parallels 10.0.1.

I also have root access on the virtual host.

I tried creating '/var/www/vhosts/$DOMAIN$/conf/vhost.conf' and then running httpdmng --reconfigure-domain $DOMAIN$, as opposed to the deprecated(?) websrvmng rebuilding.

<Directory /var/www/vhosts/$DOMAIN$/httpdocs>
admin_php_value open_basedir none
</Directory>

Restarted the server, yet the local value of the php variable open_basedir is still set. The global is null as intended.

Let me know if there's anything I'm doing wrong, or if more information would be of more use to help.

Thanks for reading, and I know this has been posted before, but like I mentioned, have still been unsuccessful.

Best,
John Doughty
 
Maybe you need to fix vhost.conf: "admin_php_value" should be replaced with "php_admin_value"
 
That was just a typo of my recollection of it. You are correct in that it should be php_admin_value. Thanks for the reply!

---------------

I solved the problem:

Actually, the issue was that Plesk overrides /etc/php.ini with a template stored in /usr/local/psa/admin/conf/templates/default/service/php.ini

So, I commented out where they where specifying the php_admin_value open_basedir {LOCATION}:TMP

vi /usr/local/psa/admin/conf/templates/default/service/php.ini

After saving, I had to reconfigure server with the following command:

/usr/local/psa/admin/bin/httpdmng --reconfigure-all

There are other options with httpdmng (which has replaced websrvmng apparently), use the -h parameter to list them.

Hope this helps anyone else in the same boat. Msg me if you hae any other questions.

ciao
 
Great Solution! Had this problem myself, spent an entire day trying to fix it until I read this post.

But the actual file (on my system at least) is

/usr/local/psa/admin/conf/templates/default/service/php.php

I just added the folders I needed included, then reloaded. BAM!! it works.
 
didnt work

Didnt work for me, I edited the /usr/local/psa/admin/conf/templates/default/service/php.ini file, but there was not any line related with open_basedir :-/
 
Back
Top