Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 22910 - php and mod_php have the same php.ini
Summary: php and mod_php have the same php.ini
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: PHP Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-06-16 01:23 UTC by Alessandro Pisani
Modified: 2003-06-29 20:39 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alessandro Pisani 2003-06-16 01:23:54 UTC
both the php and mod_php install php.ini in /etc/php4. Problem is that in some
situations it would be needed to have two different ini files since tuning may
require different options for web-based apps (mod_php) and cli-based apps.
what about using /etc/php4/mod_php/php.ini and /etc/php4/php/php.ini ?


Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Comment 1 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2003-06-18 19:55:54 UTC
It's work in progress already.
PHP already supports two ini files,
$confdir/php.ini, $confdir/php-cli.ini
Comment 2 Stuart Herbert (RETIRED) gentoo-dev 2003-06-27 10:33:11 UTC
I've added an updated set of ebuilds to bug 15650 which also address this bug.

/etc/php4/php.ini is used for PHP CLI, 
/etc/apache/conf/php.ini is used for apache 1, 
and /etc/apache2/conf/php.ini is used for apache 2.

http://bugs.gentoo.org/show_bug.cgi?id=15650

No guarantees that it'll get into portage.  Just thought you'd want to know.

Best regards,
Stu
Comment 3 Alessandro Pisani 2003-06-27 11:27:59 UTC
okay, but there's a better solution :
the man page for php (cli version - you can find it also in the sapi/cli dir of the source package) says: "php-cli.ini : the configuration file for the CLI version of PHP. php.ini : the standard configuration file will only be used when php-cli.ini cannot not be found."

so using "doins php-cli.ini"  in  the php ebuild instead of "doins php.ini" is the only change needed: php.ini and php-cli.ini can co-exist in /etc/php4.
imho this is a really lightweight change.

just my 2 cents
alessandro
Comment 4 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2003-06-27 11:52:48 UTC
I have the php-cli.ini method in there presently, but ultimately here is a better solution:
/etc/php4/${SAPI}/php.ini
then the /etc/php4 directory could have a pile of symlinks:
/etc/php4/php-cli.ini -> /etc/php4/cli/php.ini
/etc/php4/php-apache2.ini -> /etc/php4/apache2/php.ini
/etc/php4/php-cgi.ini -> /etc/php4/cgi/php.ini
/etc/php4/php-apache1.ini -> /etc/php4/apache1/php.ini

This would allow for proper flexibility when more webservers that PHP can be used with are in portage (they aren't far away).


Comment 5 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2003-06-29 20:39:00 UTC
Please see mod_php-4.3.2-r3 and php-4.3.2-r1 which will be released tonight and see if this solution is suitable.