note 88816 added to configuration.changes

From: Date: Mon, 09 Feb 2009 17:11:58 +0000
Subject: note 88816 added to configuration.changes
Groups: php.notes 
Request: Send a blank email to php-notes+get-150417@lists.php.net to get a copy of this message
Running PHP under Apache poses a major problem when it comes to per-directory configuration settings for PHP. In Apache virtual hosting, only a master PHP configuration file (i.e. php.ini) is parsed at run-time per PHP script. Under IIS 6.0 or greater, you can include per-directory PHP configuration files to override or overwrite the master configuration settings. The issue here, however, is having Apache virtual hosts override/overwrite master settings; not what IIS can do. So, there are two possible solutions. The first solution is described in this section and uses the Apache configuration settings php_value, php_flag, php_admin_value, and php_admin_flag. In that, each virtual host which you'd like to have certain configuration settings changed must have these directives set (and that is for each PHP configuration setting). This, to me, is the more viable solution, although it is time-consuming and mentally taxing. The other possible solution is to set the PHPRC environment variable. To my knowledge, all implementations of Apache HTTPD allow for the SetEnv directive to set the PHPRC variable per-virtual-host. What that does is tell PHP to look in the specified location for that virtual host's configuration settings file (i.e. "C:/path/to/custom/php.ini"). The only downside to this tactic is that EVERY virtual host's custom php.ini file must contain all set parameters. In other words, every single PHP configuration directive you have set in the master php.ini file must ALSO be set in per-virtual-host configuration settings. Doesn't that suck? It seems rather redundant to me (and completely defeats the purpose) that you have to include all configuration settings OVER AND OVER AGAIN. The great thing about per-directory configuration settings (when they're implemented correctly) is that PHP already has the master settings pre-loaded and the per-directory settings (which may only ammount to one directive in difference) can be loaded per request and, thus, there is less over-head. There really is more to this topic than that, which is why I blogged a rather lengthy and detailed article here: http://hyponiq.blogspot.com/2009/02/apache-php-multiple-phpini.html This information is meant to help users and administrators. I highly suggest it be read if anyone has any questions on Apache and PHP configurations. I have included some examples that illustrate the two possible solutions, as well. I did my best to research everything before I wrote the article. I hope this helps! ---- Server IP: 69.147.83.197 Probable Submitter: 75.76.29.219 ---- Manual Page -- http://www.php.net/manual/en/configuration.changes.php Edit -- https://master.php.net/note/edit/88816 Del: integrated -- https://master.php.net/note/delete/88816/integrated Del: useless -- https://master.php.net/note/delete/88816/useless Del: bad code -- https://master.php.net/note/delete/88816/bad+code Del: spam -- https://master.php.net/note/delete/88816/spam Del: non-english -- https://master.php.net/note/delete/88816/non-english Del: in docs -- https://master.php.net/note/delete/88816/in+docs Del: other reasons-- https://master.php.net/note/delete/88816 Reject -- https://master.php.net/note/reject/88816 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#150417) next »