On a Ubuntu 10.10 vm I installed PHP 5.3 via package manager (installed the whole lamp stack via tasksel install lamp
) for quickly testing some project.
Now I need a newer version, PHP 5.4 beta, compiled from source. I downloaded the source, compiled and installed via configure --prefix=/usr && sudo make install
That worked for the cli version that is now using the PHP 5.4 binary, but as I expected it didnt replace the version apache is using, so apache still uses PHP 5.3.
How can I find out how the via tasksel
installed version was compiled/what do I need to do in order to also upgrade the PHP version used with apache?
If the version provided by Ubuntu is still in use by Apache, a php-page like this should give you the build options:
When building from source, I rarely provide my own prefix, since the default prefixes with
/usr/local
or whatever usually make it very easy to distinct that this is a manually compiled package. This is also earlier in path, so if you have manually compiled something that the package manager also provides - the manually compiled program will be the one preferred unless a full path is specified. If I do provide a prefix, it's probably/opt
.After building and installing php, you need to restart Apache for it to load the new version of the library.
The packages provided by Ubuntu will add two files to set up Apache to use php:
+ a symlink to these files placed in
/etc/apache2/mods-enabled
. Apache will also in turn load all the files inmods-enabled
. If the install script does not create these config files for you, you need to do this manually.You should probably remove the old packages, before using a new version - to avoid confusion between which version is the one in use.