[CentOS] apache 2 and php 5.2

Tue Feb 15 21:52:47 UTC 2011
Keith Roberts <keith at karsites.net>

On Tue, 15 Feb 2011, Paul A wrote:

> To: 'CentOS mailing list' <centos at centos.org>
> From: Paul A <razor at meganet.net>
> Subject: [CentOS] apache 2 and php 5.2
>
> Hi originally I installed php 4 on centos 5.5 and then a 
> few repos including the remi repo to upgrade to php5, 
> which seems to upgrade/work without any issues.

*snip*

> I was wondering if anyone can tell me why apache is not 
> taking the settings from the /etc/php.ini file and it 
> works without that file.

Hi Paul.

Creat a php file with this as the contents:


<head>
<title>php-info</title>
</head>

<?php phpinfo(); ?>


Then load that file into your web browser.

It should produce a page showing all the active php 
configuration settings. Check the paths where php looks for 
it's php.ini files.

Obviously you need to restart apache to make the php 
module read the changes you have made to the php.ini file.

Putting a deliberate error in the php.ini file will confirm 
that you are in fact editing the correct php.ini file.

; === uncomment this line to force a php.ini parse error ===
; you need to do apachectl stop [CR] apachectl start
; to force re-reading of php.ini
; 'apachectl restart' doesn't work under Linux

;-----------------------------------------------------------

If this is a busy live server, then I'm not sure how you are 
going to do apachectl stop then apachectl start


> rpm -qa php
>
> php-5.2.17-1.el5.art

[root at karsites ~]# rpm -qa php
php-5.3.3-1.el5.remi


> php --ini
>
> PHP Warning:  PHP Startup: Unable to load dynamic library
> '/usr/lib/php/modules/pdo_odbc.so' - /usr/lib/php/modules/pdo_odbc.so:
> undefined symbol: php_pdo_get_dbh_ce in Unknown on line 0
>
> Configuration File (php.ini) Path: /etc
>
> Loaded Configuration File:         (none)

                                      ^^^^^^
This could be where your problem is. The above line should 
contain the name of the configuration file php has found and 
loaded, like this:

[root at karsites ~]# php --ini
Configuration File (php.ini) Path: /etc
Loaded Configuration File:         /etc/php.ini
Scan for additional .ini files in: /etc/php.d
Additional .ini files parsed:      /etc/php.d/curl.ini,
/etc/php.d/dom.ini,
/etc/php.d/fileinfo.ini,
/etc/php.d/json.ini,
/etc/php.d/mbstring.ini,
/etc/php.d/mysql.ini,
/etc/php.d/mysqli.ini,
/etc/php.d/pdo.ini,
/etc/php.d/pdo_mysql.ini,
/etc/php.d/pdo_sqlite.ini,
/etc/php.d/phar.ini,
/etc/php.d/soap.ini,
/etc/php.d/sqlite.ini,
/etc/php.d/wddx.ini,
/etc/php.d/xdebug.ini,
/etc/php.d/xmlreader.ini,
/etc/php.d/xmlwriter.ini,
/etc/php.d/xsl.ini,
/etc/php.d/zip.ini

[root at karsites ~]#

HTH

Keith Roberts

-----------------------------------------------------------------
Websites:
http://www.karsites.net
http://www.php-debuggers.net
http://www.raised-from-the-dead.org.uk

All email addresses are challenge-response protected with
TMDA [http://tmda.net]
-----------------------------------------------------------------