web-dev-qa-db-ja.com

最新のアップグレードでは、Apache2のphp7が無効になります

これを解決するために必要なログを教えてください。

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'.
2

問題は、Ubuntu 17.10にPHP 7.1が付属しているが、Apacheのphpモジュールが更新されていないことです。 解決策 古いモジュールを無効にして削除し、新しいモジュールをインストールして有効にします:

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
1
pa4080