最近又要開始用 PHP 做開發,每次都要查一遍怎麼安裝配置環境,各個地方寫的還不一樣很煩。自己寫。
Apache
Download頁
,下載最新版的壓縮包;F:Program FilesApache F:Program FilesApacheconf
目錄,編輯器開啟
line 37: ServerRoot "c:/Apache24" -> ServerRoot "F:/Program Files/Apache"
line 58: Listen 80 -> Listen 8080
line 242: DocumentRoot "c:/Apache24/htdocs" -> DocumentRoot "F:/Projects/php" <br>
line 243: <directory> -> <directory> <br>
line 276: DirectoryIndex index.html -> DirectoryIndex index.php index.htm index.html <br>
line 359: ScriptAlias /cgi-bin/ "c:/Apache24/cgi-bin/" -> ScriptAlias /cgi-bin/ "F:/Program Files/Apache/cgi-bin" <br>
line 375: <directory> -> <directory files> <br><br><br><br>加上對PHP的支持,在文件末尾加上下面的內容: <br></directory></directory></directory></directory>
AddType application/x-httpd-php .php .html .htm <br>
# configure thepath to php.ini <br><br><br>
如此,Apache 就設定完成。 <br><br>
PHPDownload
找到下載鏈接,下載壓縮包;F:Program Filesphp 進入中, F:Program Filesphp
目錄,將php.ini
,並用編輯器開啟這個檔案。修改以下部分:
line 736: extension_dir = "ext" -> extension_dir = "F:/Program Files/php/ext"
line 807: upload_tmp_dir = -> upload_tmp_dir = "/upload-files"
line 881: ;extension=php_curl.dll -> extension=php_curl.dll
line 883: ;extension=php_gd2.dll -> extension=php_gd2.dll
line 890: ;extension=php_mbstring.dll -> extension=php_mbstring.dll
line 892: ;extension=php_mysql.dll -> extension=php_mysql.dll
line 897: ;extension=php_pdo_mysql.dll -> extension=php_pdo_mysql.dll <br>
line 899: ;extension=php_pdo_odbc.dll -> extension=php_pdo_odbc.dll <br>
line 915: ;extension=php_xmlrpc.dll -> extension=php_xmlrpc.dll <br>
line 930: ;date.timezone = -> date.timezone = Asia/Chongqing <br>
line 1417: ;session.save_path = "/tmp" -> session.save_path = "/session" <br><br><br>
並在<br>line 892<br> 後面加入:<br>extension=php_mysqli.dll<br><br><br>進入xdebug官網,開啟
Download頁 中;
繼續編輯
php.ini
[XDebug]
xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = 0
xdebug.remote_enable = 1
xdebug.remote_handler = "dbgp"
xdebug.trace_output_dir = "F:Program Filesphpxdebug" <br><br><br><br>在firefox安裝easiest Xdebug插件;<br><br>啟動phpstorm的電話筒監聽;完成。 MySQL太簡單,就不寫了。 <br><br>
<br>
以上就介紹了Apache&PHP+Xdebug 安裝配置,包含了方面的內容,希望對PHP教學有興趣的朋友有幫助。 <br>
<br>
<br>