Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

i have a dev server (debian) managed via Plesk (9.5.2).

Im wondering if is possible to change the php.ini settings for a single host while PHP is running as FastCgi/CGI application.

If i run PHP as apache module, i can do it via vhost.conf, for example:

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

customize the open_basedir just for the example.com domain, but works only if i run php as apache module; for others motivations, i need php as a FastCGI/CGI.

I cant edit directly the php.ini, becose this would affect all my domains.

Any idea?

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

The PHP manual specifies where you can change each directive.

As far as using ini_set or .htaccess you may be out of luck, as according to the docs:

php_admin_value name value Sets the value of the specified directive. This can not be used in .htaccess files. Any directive type set with php_admin_value can not be overridden by .htaccess or ini_set(). To clear a previously set value use none as the value.

You might be able to fudge it by writing a script in your CGI directory which sets environment variables, and then starts PHP, instead of invoking PHP directly. This is detailed at http://www.fastcgi.com/drupal/node/5?q=node/10 and provides the following pointer for more info:

The README.FastCGI file, located in the PHP source, provides additional details on these and some other useful variables.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.