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

search for in the

방법 3: doc_root나 user_dir을 설정> <방법 1: 공개 파일만을 제공
Last updated: Sun, 25 Nov 2007

view this page in

방법 2: --enable-force-cgi-redirect 사용

이 컴파일시의 옵션은 누구라도 http://my.host/cgi-bin/php/secretdir/script.php와 같은 URL을 통해서 PHP를 직접 호출할 수 없게 합니다. 대신, 이 모드에서 PHP는 웹서버의 리다이렉트 규칙에 따를 때만 해석을 시도할 것입니다.

아파치에서 리다이렉션의 설정은 다음과 같은 지시자로 설정합니다:

Action php-script /cgi-bin/php
AddHandler php-script .php

이 옵션은 아파치 웹 서버에만 테스트되었고, 리다이렉트된 요청에 대해 아파치가 비표준 CGI 환경 변수 REDIRECT_STATUS를 설정하게 합니다. 웹 서버가 요청이 직접적인지 리다이렉트된 것인지의 구분을 제공하지 않는다면, 이 옵션을 사용할 수 없고, 이 문서에 제시된 다른 방법의 CGI 실행 방법을 이용해야 합니다.



add a note add a note User Contributed Notes
방법 2: --enable-force-cgi-redirect 사용
mega-squall at caramail dot com
13-Jan-2008 02:36
Contrary to what was said, you can use arbitrary names for your MIME Type ...
However there's a restriction as it must be a valid MIME Type.
For instance, this is working perfectly :

AddHandler application/x-httpd-php4 .php4
AddHandler application/x-httpd-php5 .php5 .php
AddHandler application/x-httpd-php6 .php6
gelgin at internut dot com
25-Apr-2007 10:08
solaris 9 php4.4.0
i have found you can't use arbitrary names ie.

AddType application/x-httpd-php .php

works

#AddHandler php4-script .php

won't do must be

AddHandler application/x-httpd-php
celtic at sairyx dot org
14-Dec-2006 05:24
Note that force-redirect doesn't work with IIS at all; it'll tell you to go away, as IIS doesn't supply the right variables to PHP.

php.ini tells you to turn it off, so make sure you do.

 
show source | credits | stats | sitemap | contact | advertising | mirror sites