Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:42355 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 95482 invoked from network); 19 Dec 2008 18:19:39 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Dec 2008 18:19:39 -0000 Authentication-Results: pb1.pair.com smtp.mail=jerj@coplanar.net; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=jerj@coplanar.net; sender-id=pass Received-SPF: pass (pb1.pair.com: domain coplanar.net designates 70.47.139.2 as permitted sender) X-PHP-List-Original-Sender: jerj@coplanar.net X-Host-Fingerprint: 70.47.139.2 titan.coplanar.net Received: from [70.47.139.2] ([70.47.139.2:50600] helo=titan.coplanar.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D5/59-49743-AB5EB494 for ; Fri, 19 Dec 2008 13:19:38 -0500 Received: from [70.47.139.174] (ragnarok.coplanar.net [70.47.139.174] (may be forged)) (authenticated bits=0) by titan.coplanar.net (8.14.1/8.14.1/Debian-8ubuntu1) with ESMTP id mBJIJY1C029659 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Fri, 19 Dec 2008 13:19:35 -0500 To: internals@lists.php.net Content-Type: text/plain Organization: Coplanar Networks Date: Fri, 19 Dec 2008 13:19:30 -0500 Message-ID: <1229710770.25041.99.camel@ragnarok> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-3.0 (titan.coplanar.net [70.47.139.2]); Fri, 19 Dec 2008 13:19:35 -0500 (EST) Subject: config files and PHP_CONFIG_FILE_SCAN_DIR From: jerj@coplanar.net (Jeremy Jackson) For some time, PHP has had a build option ./configure --with-config-file-scan-dir=/etc/php5/conf.d/ that allows distribution maintainers to manage system-wide PHP configuration by adding/removing individual files with configuration fragments to this directory, for example when installing a package with a compiled PHP an extension. This is an improvement over the previous situation where php.ini had to be edited by package install/remove scripts. On Debian and Ubuntu systems (and maybe others), each SAFI ie. apache2 module, cli, or cgi is compiled with a different location of php.ini and config-file-scan-dir. (which is a bit redundant, with the option of naming it php-cli.ini, php-apache2.ini etc.) Also, the config-file-scan-dir is set to /etc/php5/apache2/conf.d, /etc/php5/cli/conf.d, which are then symlinked to /etc/php5/conf.d, (also a bit redundant) So it seems, it is easy to have system-wide settings in multiple separate files, which is good for packagers, but per-SAFI configuration must still be in *one* php.ini choosen from several locations in the ini-search-path. I wonder if the config-file-scan-dir could be a path with multiple directories to search, then each SAFI could be compiled with a common and a per-SAFI directory to scan. It could be a loop around this part of main/php_ini.c around line 512: /* If the config_file_scan_dir is set at compile-time, go and scan this directory and * parse any .ini files found in this directory. */ if (!sapi_module.php_ini_ignore && strlen(PHP_CONFIG_FILE_SCAN_DIR)) { The config-file-cscan-path could then be /etc/php5/conf.d:/etc/php5/apache2.d or /etc/php5/conf.d:/etc/php5/cli.d Depending how much change is wanted/tolerated, this could get rid of the other special cases that search for ini-files in a path, which searches for php-$SAFI.ini, then php.ini, etc. since they could be put in the config-file-scan-path. -- Jeremy Jackson Coplanar Networks (519)489-4903 http://www.coplanar.net jerj@coplanar.net