I have PHP7 installed on my Ubuntu 14.04 laptop. It was working perfectly all this while. Now, for some reason my apache2 isn't starting.
anjanesh@anjanesh-Latitude-3560:~$ sudo /etc/init.d/apache2 start
* Starting web server apache2 *
* The apache2 configtest failed.
Output of config test was:
apache2: Syntax error on line 140 of /etc/apache2/apache2.conf: Syntax error on line 3 of /etc/apache2/mods-enabled/php7.0.load: Cannot load /usr/lib/apache2/modules/libphp7.0.so into server: /usr/lib/apache2/modules/libphp7.0.so: undefined symbol: ap_map_http_request_error
Action 'configtest' failed.
The Apache error log may have more information.
All the files are in place. There is libphp7.0.so in /usr/lib/apache2/modules.
Reinstalled PHP on 16.04 LTS to fix this. Note: after running
apt update
Apache2 would not install until asudo apt autoremove
had been run.Install Apache
Install MySQL
Install PHP
Start Apache
Not enough reputation to comment ...
Doing
sudo apt-get update
wasn't enough for me (OP's Comment under the question).But then also doing
sudo apt-get upgrade
fixed it.If you are upgrading your php version using ondrej ppa (sudo add-apt-repository ppa:ondrej/php). You need to upgrade the apache2 version too.
Please add the below ppa too and upgrade the apache2 package.
Then enable the libapache2-mod-php7.0 or libapache2-mod-php.
or
or
Restart the apache.
Your problem is solved.