php stops working

I have an apache24 server which has suddenly stopped formatting php statements. php has been formatting properly for months but all of a sudden info.php
Code:
<?php phpinfo(); ?>
just shows up as plain text.

I have restarted apache but it makes no difference.

Why would php stop working?
 
Execute apachectl -M and verify that either the php5_module or the php7_module is in the list of the loaded modules. In case neither is loaded, enable the module in /usr/local/etc/apache24/httpd.conf. Corresponding to the installed PHP version there must be a line either of:
Code:
LoadModule php5_module    libexec/apache24/libphp5.so
or
Code:
LoadModule php7_module    libexec/apache24/libphp7.so

Then verify that the following directive is present somewhere in your configuration files and in addition is active for the respective web site.
Code:
<IfModule php7_module>
    DirectoryIndex index.php index.html
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php-source .phps
</IfModule>

Of course if you got PHP5.x installed, the above ifModule directive should reference the php5_module.

Then you need to restart Apache.
 
Execute apachectl -M and verify that either the php5_module or the php7_module is in the list of the loaded modules. In case neither is loaded, enable the module in /usr/local/etc/apache24/httpd.conf. Corresponding to the installed PHP version there must be a line either of:
Code:
LoadModule php5_module    libexec/apache24/libphp5.so
or
Code:
LoadModule php7_module    libexec/apache24/libphp7.so

Many thanks for this. Indeed the php7_module was missing from httpd.conf - no idea how that happened. All the other php72 modules required for Wordpress were installed...
 
Actually, I know exactly who was responsible for the missing php module :rolleyes:

I was updating two jails and obviously missed out one step in one of them.
 
Back
Top