4
votes

For a certain domain I'm trying to specify php ini settings for include_path and open_basedir, but I can't get the settings to take effect. I'm using Red Hat Enterprise Linux Server 5.11 (Tikanga) and Plesk 11.0.9.

I created the file /var/www/vhosts/[my domain]/conf/vhost.conf

and added the following directives:

<Directory /var/www/vhosts/[my domain]/web>
    <IfModule sapi_apache2.c>
            php_admin_flag engine on
            php_admin_flag safe_mode off
            php_admin_value open_basedir "/var/www/vhosts/"
            php_admin_value include_path "."
    </IfModule>
    <IfModule mod_php5.c>
            php_admin_flag engine on
            php_admin_flag safe_mode off
            php_admin_value open_basedir "/var/www/vhosts/"
            php_admin_value include_path "."
    </IfModule>
            Options -Includes -ExecCGI

Then I reloaded configuration for the domain and issued a graceful restart:

/usr/local/psa/admin/bin/httpdmng  --reconfigure-domains [my domain]
/usr/sbin/apachectl graceful

According to the phpinfo issue from the document root the settings have not changed from those in the normal php.ini.

Any idea where I'm going wrong?

1
Are you running PHP as a FastCgi or Apache Module. This mechanism will only work if the answer is Apache Module - RiggsFolly
I think you nailed it. Didn't realise I had FastCgi switched on. Switched it back to apache and it works. Thanks! - hessodreamy

1 Answers

0
votes

While your PHP handler was FastCGI you can just change PHP settings in

/var/www/vhosts/[your domain]/etc/php.ini

I'd advise to use FastCGI because of performance and security aspects.