前言: 在一個裝好 apache2 和 mod_php4 的環境中, 在特定目錄跑 php5 (因為某些程式只能用 php5), 用 cgi 模式跑 php5

1.去官網抓php installer

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

Posted by hsuzy at 痞客邦 PIXNET Comments(1) Trackback(0) Hits(195)


open trackbacks list Trackbacks (0)

Comments (1)

Post Comment
  • 你的腦袋裝的跟別人不一樣
    好利害哦!

Comment Permissions: Allow commenting

Leave Comment

*Name/Nickname
E-mail
Personal Website
Comment Title
*Comment
* Private Comment