PHP: Funkce specifick� pro Apache - Manual
PHP  
downloads | documentation | faq | getting help | mailing lists | | php.net sites | links | my php.net 
search for in the  
<Reference funkc�apache_child_terminate>
view the version of this page
Last updated: Thu, 15 Jul 2004

I. Funkce specifick� pro Apache

�vod

Tyto funkce jsou k dispozici pouze pokud PHP b�� jako modul Apache 1.x.

Instalace

Instalaci PHP v Apache 1.x viz ��st Apache kapitoly o instalaci.

Konfigurace b�hu

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.

P��klad 1. Turning off PHP parsing for a directory using .htaccess

php_flag engine off

Tabulka 1. Apache configuration options

NameDefaultChangeableFunction
engineOnPHP_INI_ALLturns PHP parsing on or off
child_terminateOffPHP_INI_ALL specify whether PHP scripts may request child process termination on end of request, see also apache_child_terminate()
last_modifiedOffPHP_INI_ALLsend PHP scripts modification date as Last-Modified: header for this request
xbithackOffPHP_INI_ALLparse files with executable bit set as PHP regardless of their file ending

Zde je stru�n� vysv�tlen� konfigura�n�ch direktiv.

engine boolean

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.

Typy prost�edk�

Toto roz���en� nem� definov�n ��dn� typ prost�edku (resource).

P�eddefinovan� konstanty

Toto roz���en� nem� definov�ny ��dn� konstanty.

Obsah
apache_child_terminate -- Terminate apache process after this request
apache_get_modules --  Get a list of loaded Apache modules
apache_get_version --  Fetch Apache version
apache_getenv --  Get an Apache subprocess_env variable
apache_lookup_uri --  Prov�d� ��ste�n� po�adavek na zadanou URI a vrac� v�echno info o n�
apache_note -- Z�sk�v� a nastavuje pozn�mky po�adavku u Apache.
apache_request_headers -- Fetch all HTTP request headers
apache_response_headers --  Fetch all HTTP response headers
apache_setenv -- Set an Apache subprocess_env variable
ascii2ebcdic -- P�ekl�d� �et�zec z ASCII do EBCDIC
ebcdic2ascii -- P�ekl�d� �et�zec z EBCDIC do ASCII
getallheaders -- Z�sk�v� v�echny hlavi�ky HTTP po�adavku
virtual -- Prov�d� sub-po�adavek Apache


add a note add a note User Contributed Notes
Funkce specifick� pro Apache
gparker at connectfree dot co dot uk
18-Oct-2004 11:44
I also see php_flag settings in one Virtual Host affecting another Virtual Host SOMETIMES. In my case I have a legacy setup where a Virtual Host overrides my default php.ini configuration for register_globals and sets it on. Very infrequently my production Virtual Host (which does not override the php.ini setting) will report that it also has register_globals on.

Glad you identified the cause and a solution - I was starting to think I was going insane!

My setup is PHP 4.3.3, Apache 2.0.47 and Redhat 9
outofnet at mail dot ru
27-Aug-2004 02:44
Important info for Apache2 users that have several virtual hosts.

It seems php_flag directive has a different behaviour under Apache 2 (from what it is under 1.3) when used inside <VirtualHost> block.

If you override global php.ini settings with php_flag for one of your virtual host - then your other non-customized virtual hosts may use this overrided settings as well. php_flag records are messed up among different virtual hosts under single Apache 2 server. It may result from Apache 2 multi-thread nature.

Here is an example:

Suppose you have two Virtual hosts: V1 and V2.
For V1 in Apache configuration you use
php_flag magic_quotes_gpc 1
V2 is supposed to use global php.ini settings, so you didn't put any php_flag records into Apache conf for V2 (this worked under Apache 1.3).
And your default php.ini settings are:
php_flag magic_quotes_gpc 0

When you run your server you'll notice that magic quotes is (sometimes) set to On at V2!
The value turns On at V2 when there have been a previous request to V1.

To solve the problem either move php_flag into .htaccess located inside customized virtual host directory OR put php_flag with default settings into all your <VirtualHost> blocks that are not customized. So for V2 put:
php_flag magic_quotes_gpc 0

It is critical to be very carefull with php_flag engine 0.

My configuration is:
PHP 4.3.4, Apache 2.0.50, Linux RedHat 9
henk_nicolai at REMOVE-THIS at hotmail dot com
20-Nov-2002 12:03
My Apache server has a problem when someone enters a URI like: "". (Note the extra slash.) The server executes the index.php script anyway, which causes the browser directory and the current directory used in the script to be different. And therefore my relative links don't work, and my stylesheet is not loaded. A quick test ("") reveals that also this site has this glitch.

When a client requests a directory without the last slash ("") the server sends a HTTP 301 (Moved Permanently) response with a redirect to the correct URI (""), and my idea was to do the same when the user adds a slash too much:

<?php
   $req
= $_SERVER['REQUEST_URI'];
  
// Remove rubbish.
  
$newReq = ereg_replace ('index.php[^?]*', 'index.php', $req);
   if (
strlen($newReq) < strlen($req)) {
    
header ('Location: '.$newReq);
    
header ('HTTP/1.0 301 Moved Permanently');
     die; 
// Don't send any more output.
  
}
   unset(
$req); unset($newReq);

   ... (
rest of the script) ...
?>

Replace every occurence of 'index.php' with your filename and you're done. Hope it helps. :-)

(Note: I'm not using fragments in my URI's (like 'index.php#bottom'), and this code may not do what you want if you are using them.)
cjm2 at earthling dot net
10-Jan-2002 11:40
If you are trying to find a Handler to use with apache's mod_mime functions (e.g. SetHandler).  Use the MIME type associated with php.

e.g. SetHandler application/x-httpd-php
jarl at diku dot dk
25-Mar-2000 11:12
Many of the environment variables can be found here:

<Reference funkc�apache_child_terminate>
 Last updated: Thu, 15 Jul 2004
show source | credits | sitemap | contact | advertising | mirror sites 
Copyright © 2001-2004 The PHP Group
All rights reserved.
This unofficial mirror is operated at: /
Last updated: Sun Nov 14 23:09:54 2004 Local time zone must be set--see zic manual page