PHP安裝攻略:NT+Apache+PHP3
2024-08-27 18:28:34
供稿:網(wǎng)友
中國(guó)最大的web開發(fā)資源網(wǎng)站及技術(shù)社區(qū),
本文只討論如何在windows nt 4.0或windows 2000下安裝apache+php3。
我使用的apache為apache_1_3_12_win32.exe。
注意您得先安裝php3哦,有關(guān)php3的安裝,可查閱前面介紹的相關(guān)文章。
二、安裝apache
1、雙擊下載的apache可執(zhí)行文件(如apache_1_3_12_win32.exe)進(jìn)行安裝,安裝的時(shí)候您可以選擇安裝的目的地,缺省為c:/program files/apache group/apache。
2、修改 c:/program files/apache group/apache/conf/httpd.conf :port 80
設(shè)置apache web server運(yùn)行時(shí)使用的端口號(hào),由于我這里的iis也在運(yùn)行,iis使用了80端口號(hào),于是我把它改成port 8080,這時(shí)我在瀏覽器上輸入http://localhost:8080/才能訪問(wèn)到apache web server服務(wù)器,輸入http://localhost/時(shí)能訪問(wèn)到iis,這樣兩個(gè)web server都可以用了哦。注意有些已被其它應(yīng)用程序使用的端口號(hào)我們是不能用的,例如telnet的端口號(hào)為23,ftp的端口號(hào)為21,dns的端口號(hào)為53等等。
serveradmin [email protected] 設(shè)置管理員信箱,當(dāng)服務(wù)器出問(wèn)題時(shí),它就會(huì)把出現(xiàn)的問(wèn)題發(fā)到管理員信箱中,我這里把它改成了[email protected]
documentroot "c:/program files/apache group/apache/htdocs"
設(shè)置文檔根目錄,當(dāng)您在瀏覽器上輸入http://localhost:port端口號(hào)/時(shí),服務(wù)器會(huì)從文檔根目錄讀取數(shù)據(jù),當(dāng)然你也可以將其改成你喜歡的目錄,例如:documentroot "d:/phproot"。
注意:如果你要對(duì)documentroot指定的路徑作更改,那么httpd.conf兩處相同的地方都要作一樣的更改。
<directory "c:/program files/apache group/apache/htdocs">
把這個(gè)改成<directory documentroot所指定的目錄>,我這里為
<directory "d:/phproot">
directoryindex index.html
設(shè)置默認(rèn)文檔,為了支持php3,我把它改成了directoryindex
index.html index.htm index.php3 index.php index.phtml
3、為了使用php,還應(yīng)該在c:/program files/apache group/apache/conf/httpd.conf 文件未尾加上類似以下的一段話:
scriptalias /php3/ "c:/php3/"
addtype application/x-httpd-php3 .php3 .php .phtml
action application/x-httpd-php3 "/php3/php.exe"
注意c:/php3/應(yīng)該改為您那里的php目錄,而且要用/而不是/。
4、apache安裝完后在start菜單組中有快捷方式,運(yùn)行install apache as a service,這樣的話在nt的服務(wù)中就多了一個(gè)名為apache的服務(wù),用它可以啟動(dòng)或停止apache服務(wù)。
5、啟動(dòng)apache服務(wù),完裝完畢,祝您好運(yùn)。