http://localhost kann nach dem Upgrade von Ubuntu 15.10 -> 16.04 nicht verwendet werden

http://localhost kann nach dem Upgrade von Ubuntu 15.10 -> 16.04 nicht verwendet werden

Ich habe Lamp auf meinem 15.10 installiert. Es hat funktioniert. Gestern habe ich meinen Ubuntu-Computer von 15.10 auf 16.04 aktualisiert. Ich habe erfolglos versucht, auf localhost zuzugreifen.

Ich habe es versucht service apache2 restartund die folgende Fehlermeldung erhalten:

● 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 Sun 2017-06-25 13:50:20 IST; 1min 0s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 5414 ExecStart=/etc/init.d/apache2 start (code=exited, status=1/FAILURE)

Jun 25 13:50:20 ajay-Lenovo-G50-70 apache2[5414]:  *
Jun 25 13:50:20 ajay-Lenovo-G50-70 apache2[5414]:  * The apache2 configtest failed.
Jun 25 13:50:20 ajay-Lenovo-G50-70 apache2[5414]: Output of config test was:
Jun 25 13:50:20 ajay-Lenovo-G50-70 apache2[5414]: apache2: Syntax error on line 140 of /etc/apache2/apache2.conf: Syntax error on line 1 of /etc/apache2/mods-enabled/php5.load: Cannot load /usr/lib/apache2/modules/libphp5.so into server: /usr/lib/apache2/modules/libphp5.so: cannot open shared object file: No such file or directory
Jun 25 13:50:20 ajay-Lenovo-G50-70 apache2[5414]: Action 'configtest' failed.
Jun 25 13:50:20 ajay-Lenovo-G50-70 apache2[5414]: The Apache error log may have more information.
Jun 25 13:50:20 ajay-Lenovo-G50-70 systemd[1]: apache2.service: Control process exited, code=exited status=1
Jun 25 13:50:20 ajay-Lenovo-G50-70 systemd[1]: Failed to start LSB: Apache2 web server.
Jun 25 13:50:20 ajay-Lenovo-G50-70 systemd[1]: apache2.service: Unit entered failed state.
Jun 25 13:50:20 ajay-Lenovo-G50-70 systemd[1]: apache2.service: Failed with result 'exit-code'.

Antwort1

Verstanden, Leute! Keine Sorge!

Ich habe erfahren, dass 16.04 mit PHP 7.0 und nicht mit 5.0 ausgeliefert wird. Ich vermute, dass ich für Apache Module von PHP 5.0 installiert hatte.

Installieren des Apache-Moduls php7.0:

sudo apt-get install libapache2-mod-php7.0

Deaktivieren des PHP5-Moduls, da wir kein PHP5.0 haben:

sudo a2dismod php5

PHP7-Modul aktiviert:

sudo a2enmod php7.0

Apache neu gestartet:

sudo service apache2 restart 

das ist es, Jungs

verwandte Informationen