I want to disable php in a directory on my server. I thought that setting Options -ExecCGI in httpd.conf would prevent php scripts from being executed, but obviously I am wr
php_flag engine off
only works if you are using mod_php
(as well as mod_php7.x
) than php-fpm
Seems you are using php-fpm
, so add the further lines into httpd.conf
:
SetHandler !
or these in .htaccess
in the Directory you don't expect the execution of PHP:
SetHandler !
I have tested it on an Unix Platform rather than a Windows, Hope it would help U.