Apache + php5 problem after 12.04.3 to 14.04.i do release upgrade (server)

13,190

From the error message, the PHP5 Apache module is not present where it should.

First, check the installation status of the PHP5 module package :

user@hostname:~$ dpkg -l |grep libapache2-mod-php5
ii  libapache2-mod-php5              5.5.9+dfsg-1ubuntu4.3               amd64        server-side, HTML-embedded scripting language (Apache 2 module)

If the result is not like above (a line starting by ii) then the module is not or badly installed.

If dpkg returns no line, do :

sudo apt-get update && sudo apt-get install libapache2-mod-php5

If dpkg returns a line not starting with ii, do :

sudo apt-get purge libapache2-mod-php5
sudo apt-get update && sudo apt-get install libapache2-mod-php5
Share:
13,190
kevinx
Author by

kevinx

Updated on September 18, 2022

Comments

  • kevinx
    kevinx almost 2 years

    I did a 'do-release-upgrade' Most upgrade went fine. But the upgrade from Apache 2.2.22 to 2.4.7 went wrong. There seems to be something wrong with the php5 apache module.

    I get the following error message:

    apache2: Syntax error on line 203 of /etc/apache2/apache2.conf: Syntax error on line 
    1 of /etc/apache2/mods-enabled/php5.load: Cannot load /usr/lib/apache2/module
    /libphp5.so into server: /usr/lib/apache2/modules/libphp5.so: cannot open shared   
    object file: No such file or directory
    Action 'configtest' failed.
    

    How to fix this problem? I'll hope there is easy way to solve this problem. :)

  • Eliah Kagan
    Eliah Kagan almost 10 years
    Note sudo apt-get update && sudo apt-get --purge --reinstall install libapache2-mod-php5 will do the same thing as the second method (under "If dpkg returns a line not starting with ii"), but will wait to uninstall software until any necessary files for reinstalling it have been downloaded. This may be considered preferable in case of a network interruption (and because it requires, in a sense, fewer steps). It can also replace the first method, as it should succeed nicely even if the package isn't already installed. (So the initial dpkg -l | grep ... step could even be skipped.)