PHP configuration files location
Since there are alternative webservers (Lighttpd and Nginx) available in Slackware, I think we should also change default configuration files path. So far it's
Code:
/etc/httpd/php.ini-production Code:
1) Copy the php.ini from /etc/httpd to /etc/lighttpd Code:
/etc/php/ Code:
/etc/php-fpm/ See Gentoo directory structure Code:
# ls /etc/php/ * Stripped of exec, system and similar functions on which cli scripts relies. |
the default configuration file location (hardcoded in the interpreter at build time) is
Code:
/etc/httpd/php.ini Quote:
Code:
/usr/bin/php-cgi -c /etc/lighttpd/php.ini Quote:
|
Quote:
Quote:
|
I use both apache and lighttpd, and in my opinion having separate php.ini files for the two is a good thing as, for example, I use different php extensions with each one, and following this, having them in the webserver folder instead of a shared one seems to me more intuitive and ordered.
In some (rare) situations I instead prefer to use php-fpm and provide it for both the webservers: in this case the above hardcoded /etc/httpd/php.ini file is used and, as I told above, it's not important for me where it is as long as I know its default location: frankly is not that important for me if this is different from other distros, as they already have other configuration files in different places (like /etc/apache2 instead of /etc/httpd, and so on)... |
The common way to do this seems to be putting php.ini in /etc. Note that /etc/php is no suitable place for the main ini file as that is the lookup path for *additional* configuration, like ini files installed by pecl extensions.
Also, php has an integrated way to provide different ini files for different SAPI modules, it looks for them however in the same directory as the main ini file. And this is where semantics go a bit weird. /etc/httpd/php-cli.ini doesn't really make a lot of sense, yet this is what php on slackware looks for when called from the command line. |
Quote:
And as there could be more php.ini files (php{-cgi,-fpm}.ini), I'd rather place them in separate directory (/etc/php), like for example Code:
/etc/ssh/sshd_config Quote:
Code:
--with-config-file-path=/etc/php/cgi-php5.4 Code:
--with-config-file-path=/etc/httpd |
I don't see what building every SAPI separately brings to the table. Having separate config directories for every possible SAPI is a bit overkill.
Re /etc/php, the main problem there is that it is already used for a different purpose, and repurposing it (and introducing something like /etc/php.d) would cause a lot of required manual updating because the *.new handling of the doinst.sh won't work with that initially. And I'm not sure that using anything but /etc/php for a config directory name would solve any confusion we have now with /etc/httpd. Also having many config files for php is really a corner case, contrary to ssh. You don't *need* a separate php-cli.ini since php-cli will pick up the main php.ini just fine. Only when you want it to contain explicitely different settings does it make sense to have it, which really only a small group of people will ever want. And I'm sure that group won't mind having slight duplication in /etc. I do get the sentiment about /etc/httpd though. |
I looked a little bit under the hood of PHP and figured few things regarding different SAPI:
1) Either we could build standalone interpreter for each SAPI with all libraries and extensions included, which leads to having installed same libraries N times. 2) Or use PHP as it is, while use different config file per application via command line parameter if needed. My previous train of though was probably spoiled by Gentoo slots system and meta-distribution approach to everything. Now I agree that building separate binaries for each SAPI is overkill. Well, we could do some sort of bash black magic that Gentoo packagers do, but I don't really understand what these particular builds scripts do and how they manage to build PHP, so I would rather stay out of this road :) |
All times are GMT -5. The time now is 08:39 PM. |