0

I have two virtualhosts on an apache web server. There is a document root for each of them:

>>/var/www/vhosts/

I set up a php-fpm, now I want to set different open_basedir for each of them. I removed

>>/etc/php.ini

then created two php.ini in different folders. Then to the ini vhost config file I added the code:

PHPINIDir /var/www/vhosts/website1

but when I get phpinfo() nothing is different than before. I think I missed something! How can I force php-fpm to get both php.ini for each virtualhost ?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129

1 Answers1

0

You only need a php.ini.

You must add :

php_admin_value open_basedir /OPEN_BASEDIR_FOLDER_HERE

To each VHOST config file.

  • in which config file ? /etc/php-fpm.d/mydomaon.conf or /etc/hhtpd/site-avalable/mydomain.conf ? – Mehrdad Islamkhah Feb 24 '16 at 16:20
  • i did the exact soloution in apache webserver . no error on restarting php-fpm and httpd ! but root shellers still can browse all over the machin and in phpifo , open_basedir shown "not valued" . what am i missing ? – Mehrdad Islamkhah Feb 24 '16 at 17:20