O Apache não está em execução, mesmo após a limpeza e reinstalação

0

Depois de tentar iniciar o apache, sempre vejo essa linha:

Job for apache2.service failed because the control process exited with error code. See "systemctl status apache2.service" and "journalctl -xe" for details.
invoke-rc.d: initscript apache2, action "start" failed.

● apache2.service - LSB: Apache2 web server
● apache2.service - LSB: Apache2 web server
  Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)
  Drop-In: /lib/systemd/system/apache2.service.d
       └─apache2-systemd.conf
 Active: failed (Result: exit-code) since Fri 2018-02-16 14:33:40 EST; 7ms ago
 Docs: man:systemd-sysv-generator(8)
 Process: 3196 ExecStart=/etc/init.d/apache2 start (code=exited, status=1/FAILURE)

Feb 16 14:33:40 JohnstonHost apache2[3196]:  *
Feb 16 14:33:40 JohnstonHost apache2[3196]:  * The apache2 configtest failed.
Feb 16 14:33:40 JohnstonHost apache2[3196]: Output of config test was:
Feb 16 14:33:40 JohnstonHost apache2[3196]: apache2: Syntax error on line 140 of /etc/apache2/apache2.conf: Syntax error on line 2 of /etc/apache2/mods-enabled/php7.0.load: Cannot load /usr/lib/apache2/modules/libphp7...file or directory
Feb 16 14:33:40 JohnstonHost apache2[3196]: Action 'configtest' failed.
Feb 16 14:33:40 JohnstonHost apache2[3196]: The Apache error log may have more information.
Feb 16 14:33:40 JohnstonHost systemd[1]: apache2.service: Control process exited, code=exited status=1
Feb 16 14:33:40 JohnstonHost systemd[1]: Failed to start LSB: Apache2 web server.
Feb 16 14:33:40 JohnstonHost systemd[1]: apache2.service: Unit entered failed state.

Eu já tentei limpar, reinstalar, limpar e reinstalar o apache2-bin, limpar o php, remover o mysql, limpar tudo. Eu tentei excluir todos os usuários, exceto root, seus diretórios, recriá-los e reinstalar-se para o mesmo problema. Eu também tentei instalar e executar dois comandos que corrigiram o apache não executando, mas tentando conectar dá um erro 500. Estou usando o servidor Ubuntu assim só tenho acesso ao terminal.

    
por A. Johnston 16.02.2018 / 19:48

2 respostas

0

Você tem um erro de sintaxe na linha 2 de /etc/apache2/mods-enabled/php7.0.load . Relata que lib /usr/lib/apache2/modules/libphp7 não pode ser encontrado

Tente desabilitar o php ou php7 com o seguinte comando e ver o que acontece.

sudo a2dismod php
sudo service apache2 start

Da aparência, você não instalou todos os pacotes php necessários. Ou a instalação do php está corrompida. Normalmente,

sudo apt-get install php libapache2-mod-php 
    
por Stephen Fox 16.02.2018 / 20:14
0

Eu resolvi esse problema excluindo inadvertidamente o diretório /etc/apache2/mods-enabled e reinstalando o apache2. Eu suspeito que apenas remover php7.0.conf e php7.0.load , em seguida, reinstalar o php teria feito o truque.

    
por A. Johnston 17.02.2018 / 00:10