I tried to upgrade the php on my apache web server so ran:
root@xxxxx:~# a2enmod php7.3
Considering dependency mpm_prefork for php7.3:
Considering conflict mpm_event for mpm_prefork:
Considering conflict mpm_worker for mpm_prefork
Module mpm_prefork already enabled
Considering conflict php5 for php7.3:
Module php7.3 already enabled
Then ran
root@xxxxx:~# systemctl restart apache2
Job for apache2.service failed because the control process exited with error code.
See “systemctl status apache2.service” and “journalctl -xe” for details.
root@xxxxx:~#
Looked at systemctl status apache2.service and journalctl -xe which gave these outputs:
root@xxxxx:~# systemctl status apache2.service
● apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2020-03-19 22:57:15 CET; 11min ago
Process: 26628 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)
Mar 19 22:57:15 xxxxx.xxxxx systemd[1]: Starting The Apache HTTP Server…
Mar 19 22:57:15 xxxxx.xxxxx apachectl[26628]: apache2: Syntax error on line 140 of /etc/apache2/apache2.conf: Syntax error on line 3 of /etc/apache2/mods-enabled/php7.2.load: Cannot load /usr/lib/apache2/
Mar 19 22:57:15 xxxxx.xxxxx apachectl[26628]: Action ‘start’ failed.
Mar 19 22:57:15 xxxxx.xxxxx apachectl[26628]: The Apache error log may have more information.
Mar 19 22:57:15 xxxxx.xxxxx systemd[1]: apache2.service: Control process exited, code=exited status=1
Mar 19 22:57:15 xxxxx.xxxxx systemd[1]: Failed to start The Apache HTTP Server.
Mar 19 22:57:15 xxxxx.xxxxx systemd[1]: apache2.service: Unit entered failed state.
Mar 19 22:57:15 xxxxx.xxxxx systemd[1]: apache2.service: Failed with result ‘exit-code’.
root@xxxxx:~# journalctl -xe
Mar 19 23:09:01 xxxxx.xxxxx CRON[30180]: pam_unix(cron:session): session opened for user root by (uid=0)
Mar 19 23:09:01 xxxxx.xxxxx CRON[30181]: pam_unix(cron:session): session opened for user root by (uid=0)
Mar 19 23:09:01 xxxxx.xxxxx CRON[30182]: (root) CMD ( [ -x /usr/lib/php/sessionclean ] && if [ ! -d /run/systemd/system ]; then /usr/lib/php/sessionclean; fi)
Mar 19 23:09:01 xxxxx.xxxxx CRON[30181]: pam_unix(cron:session): session closed for user root
Mar 19 23:09:01 xxxxx.xxxxx CRON[30183]: (root) CMD ( [ -x /usr/lib/php5/sessionclean ] && /usr/lib/php5/sessionclean)
Mar 19 23:09:02 xxxxx.xxxxx CRON[30180]: pam_unix(cron:session): session closed for user root
I cannot see anything to investigate in journalctl -xe but systemctl status apache2.service refers to two syntax errors in two files.
Line 140 of /etc/apache2/apache2.conf is:
137 LogLevel warn
138
139 # Include module configuration:
140 IncludeOptional mods-enabled/.load
141 IncludeOptional mods-enabled/.conf
Line 3 of /etc/apache2/mods-enabled/php7.2.load is:
1 # Conflicts: php5
2 # Depends: mpm_prefork
3 LoadModule php7_module /usr/lib/apache2/modules/libphp7.3.so
When I look at /usr/lib/apache2/modules/. There is libphp7.4.so but not libphp7.3.so
I tried to go back to the previous version (7.0) no luck. I tried to move to the 7.4 version, no luck.
I simply do not know enough about php to interpret what is going on. Can anyone help me please? All websites are down as apache will not run.
Thanks
Geoff