MH *_*gar 3 server apache2 20.04
刚刚从 19.10 升级到 ubuntu 20.04。重新启动后,我注意到我的 apache 服务器失败了。
我跑了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.
Run Code Online (Sandbox Code Playgroud)
然后我跑了systemctl status apache2.service
,给了这个
? apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor prese>
Active: failed (Result: exit-code) since Fri 2020-05-08 02:14:14 +06; 22s >
Docs: https://httpd.apache.org/docs/2.4/
Process: 3271 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FA>
May 08 02:14:14 mahmud systemd[1]: Starting The Apache HTTP Server...
May 08 02:14:14 mahmud apachectl[3281]: apache2: Syntax error on line 146 of /e>
May 08 02:14:14 mahmud apachectl[3271]: Action 'start' failed.
May 08 02:14:14 mahmud apachectl[3271]: The Apache error log may have more info>
May 08 02:14:14 mahmud systemd[1]: apache2.service: Control process exited, cod>
May 08 02:14:14 mahmud systemd[1]: apache2.service: Failed with result 'exit-co>
May 08 02:14:14 mahmud systemd[1]: Failed to start The Apache HTTP Server.
Run Code Online (Sandbox Code Playgroud)
这是 apachectl configtest
apache2: Syntax error on line 146 of /etc/apache2/apache2.conf: Syntax error on line 3 of /etc/apache2/mods-enabled/php7.3.load: Cannot load /usr/lib/apache2/modules/libphp7.3.so into server: /usr/lib/apache2/modules/libphp7.3.so: cannot open shared object file: No such file or directory
Action 'configtest' failed.
The Apache error log may have more information.
Run Code Online (Sandbox Code Playgroud)
我该怎么办?
我从 Ubuntu 18.04 升级时遇到了同样的问题。在升级过程中,我的 php 包 7.2 被删除了。但是升级过程并没有去掉php7.2的配置。因此,我不得不禁用 php7.2 mod 并安装最新版本的 php,即 7.4。
在您的情况下,您必须禁用 php7.3 并安装 php7.4。
我使用了以下命令:
sudo a2dismod php7.3
sudo a2enmod php7.4
Run Code Online (Sandbox Code Playgroud)
要撤消使用以下命令:
sudo a2dismod php7.4
sudo a2enmod php7.3
Run Code Online (Sandbox Code Playgroud)
要列出 apache2 mods,请使用以下命令:
sudo a2query -m
Run Code Online (Sandbox Code Playgroud)
进行任何更改后,您将需要重新启动 apache2。
sudo service apache2 restart
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
3924 次 |
最近记录: |