You can invoke the interpreter under Apache 2.2 running in Windows by associating the php file extension with the interpreter binary in the registry:
AddType application/x-httpd-php .php
AddHandler cgi-script .php
In the desired <Directory>-block, configure PHP CGI as follows:
Options +ExecCGI
## Use HKEY_CLASSES_ROOT\.cgi\Shell\ExecCGI\Command
## to determine CGI script interpreter
## ("c:\program files\php-5.2.17\php-cgi.exe").
## This key must be created manually.
ScriptInterpreterSource Registry-Strict
You need to disable cgi.force_redirect in this case, which should be safe from what I understand. You could probably simply use php.exe instead of php-cgi.exe, though I'd like to have this confirmed from someone else.
방법 4: 웹 트리 외부의 PHP 파서
매우 안전한 옵션은 PHP 파서 바이너리를 웹트리 밖에 위치시키는 것입니다. 예를 들면, /usr/local/bin 안에. 이 방법의 단 한가지 단점은 다음과 같은 줄을 PHP 태그를 포함하는 모든 파일의 첫번째 줄에 넣어야 한다는 점입니다:
#!/usr/local/bin/php
이 방법을 사용할 때, PHP가 PATH_INFO와 PATH_TRANSLATED를 올바르게 다룰 수 있게 하기 위해서는 PHP 파서를 컴파일 할 때, --enable-discard-path 옵션을 주어야 합니다.
mails dot php dot net-notes at gunter dot ohrner dot net
22-Jul-2011 04:53
Andras Rokob <rokoba at bolyai dot elte dot hu>
18-Oct-2006 02:59
You can avoid the need of using the shell-escaping (#! ...) in all your php scripts if you set the executable bit on them and exploit the binfmt_misc support of the Linux kernels.
