Runtime Configuration

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

Example #1 Turning off PHP parsing for a directory using .htaccess

php_flag engine off

Apache configuration options
Name Default Changeable Changelog
engine "1" INI_ALL  
child_terminate "0" INI_ALL  
last_modified "0" INI_ALL  
xbithack "0" INI_ALL  
For further details and definitions of the INI_* modes, see the Where a configuration setting may be set.

Here's a short explanation of the configuration directives.

engine bool

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 httpd.conf file, PHP can be enabled or disabled.

child_terminate bool

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

last_modified bool

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

xbithack bool

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

add a note add a note

User Contributed Notes 1 note

up
-10
Anonymous
13 years ago
An important note:

Even though you turn off the engine with:

php_flag engine off

Doing:

php_flag engine on

does NOT turn it on. You need to instead do:

php_flag engine 1
To Top