I'm running PHP (5.3.3) as an Apache module on a Apache (2.2.17) server.
PHP 5.3.5 is already compiled, can I just run make install
to install the new PHP libraries or should the server be stopped before doing that? I'd like to avoid the latter (stopping the server) as there are many requests for static content (not PHP) as well.
Before commenting, I'm pretty sure that the upgrade will not break any PHP scripts.
Nope, it's not safe to install PHP (module) over an existing running installation. This may render your webserver in a unstable state. The webserver should be stopped before overwriting an existing PHP installation.
Instructions for upgrading PHP while the webserver is running
If your website is serving both static content and PHP content, consider removing the next line from
httpd.conf
for disabling PHP:Deny access to files with an '.php' extension if php5_module is not loaded (this should be present on every installation to prevent source exposure):
Then reload your Apache configuration:
Install PHP from your source directory:
This command should add a
LoadModule php5_module modules/libphp5.so
to thehttpd.conf
file too, checking whether it has been added or not does not hurt.And finally reload the configuration to enable PHP support again:
It should be fine to
make install
and then proceed to restart the server, have done it in the past myself.Just as a safeback be sure to do a tar of your previous php libraries, just in case the upgrade doesn't go well! ;)