简体   繁体   中英

Setting php ini settings in domain vhost.conf

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM