I had Drupal 8.2.4 running under Ubunutu 16.04.
Now, I get next error message when launching localhost or localhost/user or localhost/phpinfo.php, etc... :
"handle($request); $response->send(); $kernel->terminate($request, $response); "
Apache 2.4.18 is up and running.
Any idea how to fix it?

Comments

pheski’s picture

jjgw’s picture

The problem was caused by php.
I don't understand what happened, but php -v said that php was not installed (despite present in /etc/php/7.0)
After removing/purging the existing php7, I reinstalled with sudo apt-get -y install php7.0 libapache2-mod-php7.0
Now the error message "handle($request); $response->send(); $kernel->terminate($request, $response);" was gone, but instead I got "localhost : The website encountered an unexpected error. Please try again later."
Apparently a lot of libraries were missing.
I added with sudo apt-get install php7.0-fpm php7.0-mysql php7.0-gd php7.0-dom -y
Now Drupal is running again on localhost.
The only thing that still worries me is the warning "Drupal core update status No update data available " in the status report. Running cron or manual check don't solve.
There is also next warning in the log file :"Warning: file_get_contents(libraries/json2/json2.js): failed to open stream: No such file or directory in Drupal\Core\Asset\JsOptimizer->optimize()...."
The report says that 8.2.4 is installed, while there is no trace of it in the CHANGELOG.txt file.
Is here is someone familiar with it?

jjgw’s picture

Yep! 2 years later same issue after upgrading Ubuntu 16.04LTS to 18.04LTS
Apparently during this upgrade PHP 7.2.19 was installed and some necessary modules were missing.
The problem was solved by entering :
 

sudo apt-get install php7.2-fpm php7.2-mysql php7.2-gd php7.2-dom -y
sudo service apache2 restart
NexusStar’s picture

I have similar problem after trying to upgrade php from 7.0 to 7.1 on Ubuntu 16.04  following this guide.

It turns out that php installed correctly but apache2 php7.1 module was not enabled so I need to enable it.

After that it just works.

Entering The Dip and trying to win over it.

bahson’s picture

Anyone got this to work on windows, am still stuck

vm’s picture

Can you elaborate? I've a dev environment in windows using WAMP without issue. The above posts are discussing Ubuntu. I venture you're asking on this thread because the 'localhost is down' error is the issue?

adminMN2023’s picture

I have it running on Windows using XAMPP, and I'm admittedly, not the most technical person when it comes to most admin/hosting/localhost issues.

Like VM suggests - you may want to search under localhost/windows.

yan’s picture

In my case the problem was rooted in an upgrade of the (local) server from Ubuntu 16.04 to 18.04 which includes an upgrade to PHP 7.2. I found the solution here: https://askubuntu.com/q/973261

This solved it:

sudo a2dismod php7.2
sudo apt install libapache2-mod-php7.2
sudo a2enmod php7.2
sudo systemctl restart apache2.service
jakegibs617’s picture

for my situation, I got this error when upgrading from PHP 7 to PHP 8

it ended up being that LoadModule php_module modules/libphp.so was not being hit. 

in the php.conf the code looked like below:

<IfModule !mod_php5.c>
  <IfModule !mod_php7.c>
      <IfModule prefork.c>
        LoadModule php_module modules/libphp.so
      </IfModule>
  </IfModule>
</IfModule>

as you can see if php8, that line was never hit. 

once this file was updated to the following, the error was resolved

# Cannot load multiple php5, php7, php8 and php modules
<IfModule !mod_php5.c>
  <IfModule !mod_php7.c>
    <IfModule !mod_php8.c>
      <IfModule prefork.c>
        LoadModule php_module modules/libphp.so
      </IfModule>
    </IfModule>
  </IfModule>
</IfModule>
<FilesMatch \.php$>
  SetHandler application/x-httpd-php
</FilesMatch>