一:PHP開發環境配置:
1)、Apache服務器搭建:
a、next->localhost、localhost、管理員郵箱、for all Users..
b、測試安裝是否成功:localhost/或
c、配置:打開
找到DocumentRoot "C:/programfile/Apache/Apache2/htdocs"這是Apache的默認
Web文檔文件夾 ,將其設置為E:/httproot。
找到將其改成E:/httproot
。
Apache server restart、localhost/,進行測試。
找到DirectoryIndex 在後面加入
。
保存文件,Apache server配置完成。
2)、PHP安裝:
a、解壓到硬盤上的一個文件夾內如C:PHP,找到-recommended文件改其名為
。
b、打開,找到extension_dir="./"改為extension_dir="E:/PHP/ext"。
c、找到;extension=PHP_
;extension=PHP_
;extension=PHP_
;extension=PHP_
這4行,把前面的;去掉,讓這3行生效,讓PHP支撐MySQL和GD庫等組件。
將文件複製到C:windows下面
d、在E:/PHP/創建文件夾session_tmp,找到_path的這一行,設成
_path="E:/PHP/session_tmp"。這句話是讓產生的'session文件都存到自定義
目錄 中。
e、保存。
3)、Apache Server 使用PHP程序來解釋php腳本:
打開,在最後加入這幾行後保存。
LoadModule php5_module E:/PHP/php5apache2_
PHPIniDir "E:/PHP/"
AddType application/x-httpd-PHP
測試:
創建文件,內容為
<?php
phpinfo();
?>
瀏覽器中輸入localhost/運行該腳本。
4)、MySQL安裝:
a、Custom->This feature,and all subfeatures,will be installed on local hard
drive,(Developer Components、MySQL Server、Client Programs、
Document)->Install->next->finish
b、Detailed Configuration->Server Machine->Transactional Database
Only->InnoDB Tablespace進行配置就是為InnoDB數據庫文件選擇存儲空間,可以自定義
->Manual Setting,1000->啟用TCP/IP,默認端口3306不變->Manual Selected Default
Character Set/Collation,gbk->全部選擇,next->Modify Security Settings,root密碼
->Execute.
測試:在Windows控制面板中->服務管理找到MySQL服務,啟動。
5)、PEAR安裝:
PEAR:P HP擴展與應用庫,是尋找並重用優秀PHP代碼的最有效方式。
安裝步驟:a、PHP根目錄執行
b、enter->all->enter
c、PHP目錄找到PEAR_執行,PHP目錄找到執行。
d、打開cmd,進入PHP目錄,輸入pear -V查看是否安裝成功。
常用命令:pear:查看常用命令。
pear list:查看已經安裝的PEAR包。