3

Please let me know what logs you need to be able to solve this..

root@BudanParakeet:/etc/apache2/mods-enabled# uname -v
#19-Ubuntu SMP Wed Oct 11 18:33:49 UTC 2017
root@BudanParakeet:/etc/apache2/mods-enabled#

root@BudanParakeet:/etc/apache2/mods-enabled# vi php7.0.conf 
root@BudanParakeet:/etc/apache2/mods-enabled# service apache2 restart
Job for apache2.service failed because the control process exited with error code.
See "systemctl  status apache2.service" and "journalctl  -xe" for details.
root@BudanParakeet:/etc/apache2/mods-enabled# journalctl -xe
-- Unit UNIT has finished starting up.
-- 
-- The start-up result is done.
nov 05 18:35:57 BudanParakeet systemd[1]: Starting The Apache HTTP Server...
-- Subject: Unit apache2.service has begun start-up
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- Unit apache2.service has begun starting up.
nov 05 18:35:57 BudanParakeet apachectl[4502]: apache2: Syntax error on line 146 of /etc/apache2/apache2.c
nov 05 18:35:57 BudanParakeet apachectl[4502]: Action 'start' failed.
nov 05 18:35:57 BudanParakeet apachectl[4502]: The Apache error log may have more information.
nov 05 18:35:57 BudanParakeet systemd[1]: apache2.service: Control process exited, code=exited status=1
nov 05 18:35:57 BudanParakeet systemd[1]: Failed to start The Apache HTTP Server.
-- Subject: Unit apache2.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- Unit apache2.service has failed.
-- 
-- The result is failed.
nov 05 18:35:57 BudanParakeet systemd[1]: apache2.service: Unit entered failed state.
nov 05 18:35:57 BudanParakeet systemd[1]: apache2.service: Failed with result 'exit-code'.
pa4080
  • 29,831
  • 4
    So what is the syntax of "Syntax error on line 146 of /etc/apache2/apache2.c" ? – Panther Nov 05 '17 at 17:53
  • it points to LoadModule php7_module /usr/lib/apache2/modules/libphp7.0.so called from root@BudanParakeet:/etc/apache2/mods-enabled# vi /etc/apache2/mods-enabled/php7.0.load – SeductiveApps.com Nov 05 '17 at 18:30
  • I suppose the full file name wit the error on line 146 is /etc/apache2/apache2.conf. But it is unclear what means The latest upgrade. Is it a upgrade to Ubuntu 17.10? I couldn't found the exact answer that I saw these days, but there was desried similar issue. The problem was that 17.10 comes with PHP 7.1, but Apache's php module wasn't updated. So the solution was sudo a2dismod php7.0; sudo apt install libapache2-mod-php7.1; sudo a2enmod php7.1; sudo systemctl restart apache2.service. – pa4080 Nov 05 '17 at 18:31
  • @pa4080 don't you want to put that as an answer? – Videonauth Nov 06 '17 at 06:38
  • It should be duplicate of PHP not working after upgraded to Ubuntu 17.10. But I found it too late. – pa4080 Nov 22 '17 at 21:31

1 Answers1

3

The problem could be that, Ubuntu 17.10 comes with PHP 7.1, but the Apache's php module wasn't updated. So the solution could be to disable and remove the old module and install and enable the new one:

sudo a2dismod php7.0
sudo apt remove libapache2-mod-php7.0
sudo apt install libapache2-mod-php7.1
sudo a2enmod php7.1
sudo systemctl restart apache2.service
pa4080
  • 29,831