PHP.ini Fine from command line - Ignored by Apache
Posted: Fri Nov 06, 2009 2:30 pm
Ive been going round in circles for ages, when viewing the output of a
test file that simply prints the phpinfo data when viewed via the
command line the php output shows all relevant config data as read via
/etc/php.ini however when viewed via the web this is not the case, even
though phpinfo says it is reading from the same file /etc/php.ini
There are no other php.ini files on the entire system.
Any ideas please?
Snippets of both outputs
First from the web/Apache
Secondly from the command line
As you can see from the outputs, whats enabled/disabled is not the same
as when viewed from the web various loaded modules are not enabled. Its basically like Apache is totally ignoring php.ini
I have tried adding
PHPIniDir "/etc"
into the apache conf (even tho phpinfo output indicates it knows where php.ini is already) but to no avail.
test file that simply prints the phpinfo data when viewed via the
command line the php output shows all relevant config data as read via
/etc/php.ini however when viewed via the web this is not the case, even
though phpinfo says it is reading from the same file /etc/php.ini
There are no other php.ini files on the entire system.
Any ideas please?
Snippets of both outputs
First from the web/Apache
=/usr' '--with-xml' '--with-system-tzdata' '--with-apxs2=/usr/sbin/apxs' '--without-mysql' '--without-gd' '--without-odbc' '--disable-dom' '--disable-dba' '--without-unixODBC' '--disable-pdo' '--disable-xmlreader' '--disable-xmlwriter' Server API Apache 2.0 Handler Virtual Directory Support disabled Configuration File (php.ini) Path /etc/php.ini
Secondly from the command line
le-xmlwriter=shared' '--enable-fastcgi' '--enable-pdo=shared' '--with-pdo-odbc=shared,unixODBC,/usr' '--with-pdo-mysql=shared,/usr' '--with-pdo-pgsql=shared,/usr' '--with-pdo-sqlite=shared,/usr' '--enable-dbase=shared' Server API => Command Line Interface Virtual Directory Support => disabled Configuration File (php.ini) Path => /etc/php.ini
As you can see from the outputs, whats enabled/disabled is not the same
as when viewed from the web various loaded modules are not enabled. Its basically like Apache is totally ignoring php.ini
I have tried adding
PHPIniDir "/etc"
into the apache conf (even tho phpinfo output indicates it knows where php.ini is already) but to no avail.