Apache Disable PHP for a web site
To disable PHP for a web site edit VirtualHost entry of the web site and add
1 |
php_flag engine off |
Restart Apache
1 |
systemctl restart apache2 |
Method 2
Add following code in VirtualHost entry
1 2 3 |
<FilesMatch ".+\.ph(ar|p|tml)$"> SetHandler none </FilesMatch> |
Restart Apache.
Method 3
Add following code to Apache VirtualHost entry
1 2 3 |
<Directory /var/www/html> php_admin_flag engine Off </Directory> |
Then restart the Apache web server. Change folder /var/www/html to your DocumentRoot directory.