# Should I re-compile Apache too while upgrading the PHP?



## aurora (Feb 27, 2010)

Hello,

I'm upgrading the PHP version from 5.2.8 to 5.3.1 using the source code (i.e. recompiling it) but have difficulties introducing the newly compiled PHP binaries to the Apache (v 2.2.11). (I still see the old version when I checked the usual phpinfo page.)

When I take a look at Installing PHP on Unix systems using Apache 2.x it talks about getting the Apache source and compiling it along with the PHP. 

Here, I already have a good version of Apache running on my system and I see no need to re-compile it just because of a PHP upgrade. There's no section in php.net telling how to upgrade PHP with no Apache compilation involved. 

I wonder how you upgrade your PHP versions: Do you re-compile Apache too, while upgrading the PHP? Is it obligatory to re-build Apache while upgrading the PHP?

Thanks.


----------



## DutchDaemon (Feb 27, 2010)

My gut feeling is that recompiling the php module for Apache and restarting Apache (making sure it calls the right module) _should_ be enough.. As far as I know, Apache and PHP are linked through that module, and not much (if anything) else.


----------



## amitabh (Feb 27, 2010)

You should not be required to compile Apache for upgrading PHP. Is your original installation done through ports, and the current one through source code compile? In that case, you might also look at the possibility of binaries for the new version being installed at a different place.


----------



## gilinko (Feb 27, 2010)

You only need to recompile the php module, and then restart apache when it's done. And I would also suggest a move from compiling it "yourself" to use the ports tree.


----------

