We upgraded our Debian web server to Wheezy this morning, and after everything else came up fine, Apache appears to have lost the ability to execute PHP scripts, while it was able to do so before the upgrade. Now we only see the PHP code, as if the PHP module weren't enabled.
I've checked all the usual suspects, ensured that the PHP module is loaded and installed, and made sure /etc/apache2/mods-enabled/php5.conf has the "SetHandler application/x-httpd-php" option set. I've also followed the most recent documentation for installing PHP5 on Apache, and everything appears to check out. There aren't any errors in the Apache error log either that would indicate a problem.
Is there anything I've missed?
Output from 'apachectl -t -D DUMP_MODULES |grep php':
Syntax OK
php5_module (shared)
Output from 'www3:/etc/apache2# apache2 -v':
Server version: Apache/2.2.22 (Debian)
Server built: Jan 31 2014 18:55:37
Contents of /etc/apache2/mods-enabled/php5.conf:
<IfModule libphp5.so>
# <FilesMatch "\.ph(p3?|tml)$">
# </FilesMatch>
<FilesMatch "\.php$">
SetHandler application/x-httpd-php
</FilesMatch>
# To re-enable php in user directories comment the following lines
# (from <IfModule ...> to </IfModule>.) Do NOT set it to On as it
# prevents .htaccess files from disabling it.
<IfModule mod_userdir.c>
<Directory /home/*/public_html>
php_admin_value engine Off
</Directory>
</IfModule>
</IfModule>
Latest apache error logs from the last restart:
[Thu Apr 10 15:35:44 2014] [notice] caught SIGTERM, shutting down
[Thu Apr 10 15:35:45 2014] [warn] No JkLogFile defined in httpd.conf. Using default /var/log/apache2/mod_jk.log
[Thu Apr 10 15:35:45 2014] [warn] No JkShmFile defined in httpd.conf. Using default /var/log/apache2/jk-runtime-status
[Thu Apr 10 15:35:45 2014] [warn] Init: Name-based SSL virtual hosts only work for clients with TLS server name indication support (RFC 4366)
[Thu Apr 10 15:35:45 2014] [notice] suEXEC mechanism enabled (wrapper: /usr/lib/apache2/suexec)
[Thu Apr 10 15:35:45 2014] [notice] Digest: generating secret for digest authentication ...
[Thu Apr 10 15:35:45 2014] [notice] Digest: done
[Thu Apr 10 15:35:45 2014] [warn] No JkLogFile defined in httpd.conf. Using default /var/log/apache2/mod_jk.log
[Thu Apr 10 15:35:45 2014] [warn] No JkShmFile defined in httpd.conf. Using default /var/log/apache2/jk-runtime-status
[Thu Apr 10 15:35:45 2014] [warn] Init: Name-based SSL virtual hosts only work for clients with TLS server name indication support (RFC 4366)
[Thu Apr 10 15:35:45 2014] [notice] Apache/2.2.22 (Debian) DAV/2 SVN/1.6.17 mod_fcgid/2.3.6 mod_jk/1.2.37 PHP/5.4.4-14+deb7u8 mod_ssl/2.2.22 OpenSSL/1.0.1e mod_perl/2.0.7 Perl/v5.14.2 configured -- resuming normal operations
Try running the following commands:
This will reinstall all the necessary packages to get Apache capable of running mod_php.
You might also make sure that the file php5.conf is in the directory /etc/apache2/mods-enabled. If it is, you should see something like:
It turns out that this is a problem with one of the Apache modules. Disabling most of them resolved the problem and then we started adding them back until everything else was working.
php5-suhosin
is no longer available in wheezy, but unless you purge the package, its.ini
file is still in/etc/php5/conf.d/
which will prevent PHP from running.See: https://www.debian.org/releases/stable/i386/release-notes/ch-upgrading.html#idp836640