4

I was making changes to Apache and killed the configuration. Apache didn't work. So, I removed it and reinstalled. Apache works. Mysql works. But, the PHP test won't work. The php test file is there in /var/www/html but won't come up. http://localhost/test2.php in the browser just give me an empty screen.

Reinstalling PHP doesn't seem to help. I just get a blank screen without an error message. WordPress doesn't come up either.

Any suggestions?

Error Log:

[Sun Nov 05 16:34:24.764857 2017] [mpm_event:notice] [pid 3887:tid 140535676766080] AH00489: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Sun Nov 05 16:34:24.764954 2017] [core:notice] [pid 3887:tid 140535676766080] AH00094: Command line: '/usr/sbin/apache2'
[Sun Nov 05 16:37:41.761332 2017] [mpm_event:notice] [pid 3887:tid 140535676766080] AH00491: caught SIGTERM, shutting down
[Sun Nov 05 16:37:42.834654 2017] [mpm_event:notice] [pid 4105:tid 140542285068160] AH00489: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Sun Nov 05 16:37:42.834749 2017] [core:notice] [pid 4105:tid 140542285068160] AH00094: Command line: '/usr/sbin/apache2'
[Sun Nov 05 16:57:35.990992 2017] [mpm_event:notice] [pid 4105:tid 140542285068160] AH00491: caught SIGTERM, shutting down
[Sun Nov 05 16:57:37.056553 2017] [mpm_event:notice] [pid 4647:tid 140007533836160] AH00489: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Sun Nov 05 16:57:37.056632 2017] [core:notice] [pid 4647:tid 140007533836160] AH00094: Command line: '/usr/sbin/apache2'
[Sun Nov 05 18:01:18.870157 2017] [mpm_event:notice] [pid 4647:tid 140007533836160] AH00491: caught SIGTERM, shutting down
[Sun Nov 05 18:01:19.944634 2017] [mpm_event:notice] [pid 6272:tid 140286123997056] AH00489: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Sun Nov 05 18:01:19.944719 2017] [core:notice] [pid 6272:tid 140286123997056] AH00094: Command line: '/usr/sbin/apache2'
[Sun Nov 05 18:07:31.641146 2017] [mpm_event:notice] [pid 6272:tid 140286123997056] AH00491: caught SIGTERM, shutting down
[Mon Nov 06 06:55:45.343332 2017] [mpm_event:notice] [pid 1031:tid 139664376633216] AH00489: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Mon Nov 06 06:55:45.366228 2017] [core:notice] [pid 1031:tid 139664376633216] AH00094: Command line: '/usr/sbin/apache2'
[Mon Nov 06 07:00:30.525862 2017] [mpm_event:notice] [pid 1031:tid 139664376633216] AH00493: SIGUSR1 received.  Doing graceful restart
pa4080
  • 30,621
givonz
  • 611

1 Answers1

3

Try to install and enable the php module, restart Apache:

sudo apt install libapache2-mod-php7.0  
sudo a2enmod php7.0                     
sudo systemctl restart apache2.service  

Then try to access your <?php phpinfo(); ?> page again.


Here is what the above command do:

  • apt install libapache2-mod-php7.0 - Install the Apache's PHP module for php7.0.

  • a2enmod php7.0 - Enable the module - this command will create a symbolic link for module's files from /etc/apache2/mods-available to /etc/apache2/mods-enabled.

  • systemctl restart apache2.service - Restart Apache to accept the new configuration (it can be just reload).

    All modules from the directory /etc/apache2/mods-enabled are included within the Apache's main configuration file /etc/apache2/apache2.conf by the directives:

    IncludeOptional mods-enabled/*.load
    IncludeOptional mods-enabled/*.conf
    
pa4080
  • 30,621