Tuesday, December 20, 2005

PHP on Apache and Pear not using same version of PHP

There are so many ways you get this error, usually masked as something else.

What happens is, you compile and install a new version of PHP. It installs for you the mod_php or libphp4.so file so that apache can use it... and as long as you have a php.ini, it does. A problem scenario might be when you attempt to use Pear to install something, in my case Image_Color, and it says it 'gd' is not enabled in PHP -- despite that I just enabled it, and my phpinfo says it's in there.

Most sites, if I was lucky enough to find any, suggested that it was using the wrong php.ini. But pear uses (probably) /usr/bin/php.ini

What probably happened was:

1. you didn't specify a '--bindir=/usr/bin' to the new php

2. you didn't copy the new php you created when you compiled php to wherever it's looking for it (/usr/bin/)

If you do a search for 'php' you'll get probably way more listings than you hope. But if you look for phpize, you might find the directory where the new php files reside. run this:

% find / -name phpize
OR
% locate phpize

You can locate as long as you're locate.updatedb has been run since you configured php.

For me, it was in /usr/local/bin. I copied php* to /usr/bin and viola.

Hope this helps.

0 Comments:

Post a Comment

<< Home