php8.5
Home/ Manual/ reference / apache/ Turning off PHP parsing for a directory using Htaccess

Turning off PHP parsing for a directory using Htaccess

The behaviour of the Apache PHP module is affected by settings in Ini. Configuration settings from Ini may be overridden by php_flag settings in the server configuration file or local Htaccess files.

Runtime

The behaviour of the Apache PHP module is affected by settings in Ini. Configuration settings from Ini may be overridden by php_flag settings in the server configuration file or local Htaccess files.

Turning off PHP parsing for a directory using Htaccess

php
php_flag engine off
NameDefaultChangeableChangelog
engine"1"INI_ALL
child_terminate"0"INI_ALL
last_modified"0"INI_ALL
xbithack"0"INI_ALL

Constants

Title

enginebool

Turns PHP parsing on or off. This directive is really only useful in the Apache module version of PHP. It is used by sites that would like to turn PHP parsing on and off on a per-directory or per-virtual server basis. By putting engine off in the appropriate places in the Conf file, PHP can be enabled or disabled.

child_terminatebool

Specify whether PHP scripts may request child process termination on end of request, see also apache_child_terminate().

last_modifiedbool

Send PHP scripts modification date as Last-Modified: header for this request.

xbithackbool

Parse files with executable bit set as PHP regardless of their file ending.

Source: reference/apache/ini.xml · from the official PHP manual (php/doc-en)