apache2.0.39 php4.2.3在windowsXP下模組方式搭建.
最後更新:2017-02-28
來源:互聯網
上載者:User
apache|window WindowsXP+Apache2.0.39+php-4.2.3-dev
源檔案下載:
1. http://www.apache.org/dist/httpd/binaries/win32/
下面的 apache_2.0.39-win32-x86-no_ssl.msi
或者apache_2.0.39-win32-x86-no_ssl.exe
(A full setup package (.exe) containing the Win9x/WinNT
Microsoft System Installer installer is available.
If the Microsoft System Installer is already on the machine,
there is no need to download the .exe, save yourself 3MB and
download the .msi package.)
2. http://snaps.php.net/win32/php4-win32-STABLE-latest.zip
安裝伺服器和php:
1.選中下載的apache的msi檔案,單擊右鍵選擇安裝,預設即可
2.解壓縮php4-win32-STABLE-snapshotnumber.zip,得到
php4-win32-STABLE-snapshotnumber檔案夾,重新命名為php,並
複製到c:下.
3.將c:php下的php4ts.dll複製到c:wondowssystem32下(即PATH環境變數的
第一個路徑名)
(4.將c:phpdll下所有.dll檔案複製到c:wondowssystem32下.)見下面
配置php.ini和http.conf
1.將c:phpphp.ini-dist複製到c:windows下,改名為php.ini
2.開啟php.ini檔案,找到'doc_root='項,置為
doc_root="C:Program FilesApache GroupApache2htdocs"
即在這個目錄(apache伺服器主文件目錄)下的php檔案才可以執行.
找到'extension_dir='項,置為
extension_dir ="C:PHPsapi"這裡面有擴充庫的.dll檔案(注意,
當網頁不能執行,給出錯誤不能找到.dll檔案時,將c:phpsapi下所有
.dll複製到c:windowssystem32下).
儲存php.ini並退出編輯.
3.開啟c:progame filesapache groupapache2confhttpd.conf
確保servername 設定好(最起碼localhost),
找到一系列 LoadModule開頭的指令項,在最後加入如下內容:
LoadModule php4_module c:/php/sapi/php4apache2.dll
<FilesMatch ".php$">
SetOutputFilter PHP
</FilesMatch>
接下來找到AddTYpe application/x-tar.tgz 指令,在其後加入:
AddType application/x-httpd-php .php
儲存httpd.conf,並退出編輯.
重啟apache2服務
可以在命令列方式下鍵入:
net stop apache2
net start apache2
在....htdocs/目錄下加入.php檔案如index.php,在瀏覽器地址欄內鍵入
http://localhost/index.php
試試看,希望你好運!!