views:

427

answers:

3

I am running Apache2 on a Mac OS X (10.5). I just compiled PHP 5.2.8 and finally got pdo-mysql working (or so I think). My command line "php --version" is showing 5.2.8 and I have the right modules installed. But, when do a phpinfo(), Apache dumps out PHP 5.2.6 (my earlier version, without pdo_mysql). How do I tell Apache which PHP to load? The httpd.conf has the line:

LoadModule php5_module libexec/apache2/libphp5.so

But, I don't know what or where that is. Is that what I have to change?

+2  A: 

Apache should be looking for modules in "/usr/libexec/httpd/". In there you'll find either a file or symlink called "libphp5.so". If it's a symlink, you'll need to relink to the new 5.2.8 libphp5.so, otherwise just copy the 5.2.8 libphp5.so to "/usr/libexec/httpd/" and restart apache with "sudo apachectl restart".

Tautologistics
+2  A: 

You can find files on your system with the locate command:

# locate libphp5.so

It will print the full paths of all files with that name. I have one at /usr/libexec/apache2/libphp5.so.

Rob Kennedy
+1  A: 

When you compiled php did you use make install? If you did find the path that it installed your module to and change your apache config to point to it. Mac has it's own version of apache and php5 already installed which is why you are seeing a different version.

Ruggs