前言: 在一個裝好 apache2 和 mod_php4 的環境中, 在特定目錄跑 php5 (因為某些程式只能用 php5), 用 cgi 模式跑 php5
2.執行抓下來的檔案, 選 "Apache CGI"
3.安裝路徑建議選 "C:\php5"
4.編輯 httpd.conf, 在 httpd.conf 的最後加上, #為註解
# php4 的 ini 檔路徑, 沒設定的話, 我實驗過它會先找到 c:\php5\php.ini
PHPIniDir "C:/WINDOWS"
# 讓它php5目錄可以執行 cgi
<Directory "C:/php5/">
Options ExecCGI
Order allow, deny
Allow from all
</Directory>
# 指定副檔名 .php5 的跑 php5, 才不會跟 .php 衝到
ScriptAlias /php5/ "C:/php5/"
AddHandler php5-fcgi .php5
Action php5-fcgi "php5/php-cgi.exe"
# 你想要跑 php5 的目錄, 把它指定 .php 跑 php5
<Directory "C:/xxx/xxx/xxx">
AddHandler php-fcgi .php
</Directory>
參考網站: http://wiki.cheyingwu.tw/ApacheHTTPServer/Apache2-PHP4-and-PHP5-coexist
Recommend to Front page



好利害哦!
Comment Permissions: Allow commenting