PHP
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

ascii2ebcdic> <apache_response_headers
Last updated: Sun, 25 Nov 2007

view this page in

apache_setenv

(PHP 4 >= 4.2.0, PHP 5)

apache_setenv — 아파치의 서브프로세스의 환경 변수를 설정합니다.

설명

bool apache_setenv ( string $variable , string $value [, bool $walk_to_top ] )

apache_setenv()variable 로 지정한 아파치 환경 변수를 설정합니다.

Note: 아파치 환경 변수를 설정할 때, 해당하는 $_SERVER 변수는 바뀌지 않습니다.

매개변수

variable

설정할 환경 변수

value

variable 값.

walk_to_top

모든 아파치 레이어에서 사용할 수 있는 최고 레벨 변수를 설정할 지 여부

반환값

성공할 경우 TRUE를, 실패할 경우 FALSE를 반환합니다.

예제

Example#1 apache_setenv()를 사용하여 아파치 환경 변수 설정하기

<?php
apache_setenv
("EXAMPLE_VAR""Example Value");
?>

주의

Note: apache_setenv()apache_getenv()과 함께 PHP 스크립트에서 읽어들이는 Server Side Includes(.shtml)에 변수를 설정하여 나눠진 페이지에서 같은 값을 사용할 수 있습니다.



ascii2ebcdic> <apache_response_headers
Last updated: Sun, 25 Nov 2007
 
add a note add a note User Contributed Notes
apache_setenv
RLG
10-Jan-2006 04:16
If you are using mod_gzip or mod_deflate to compress HTML output, you're not able to send partial file to the browser....

To disable mod_deflate in PHP (if needed), you can tell Apache with this :

apache_setenv('no-gzip', '1');
guilleva at gmail dot com
28-Jul-2005 10:25
When you need to set the QUERY_STRING variable into a page included with the "virtual" function do this:

virtual ("some_page.shtml?$QUERY_STRING");

apache_setenv does not work for this case.
phpnotes at kipu dot co dot uk
03-Jun-2003 06:34
If you set a variable, either new or existing, the corresponding $_SERVER variable is not changed, and you will have to change it as well.
sixxgate at yahoo dot com
22-Jan-2003 03:56
When you want to set variables to pass to Server Side Includes (.shtml) included in PHP scripts, use this.

ascii2ebcdic> <apache_response_headers
Last updated: Sun, 25 Nov 2007
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites