Rumah > Artikel > pembangunan bahagian belakang > Apache&PHP+Xdebug 安装配置
最近又要开始用 PHP 做开发,每次都要查一遍怎么安装配置环境,各个地方写的还不一样很烦。自己写。
Apache
Download页面
,下载最新版的压缩包;F:\Program Files\Apache
中;F:\Program Files\Apache\conf
目录,编辑器打开 httpd.conf
文件。修改如下部分: <br>
line 37: ServerRoot "c:/Apache24" -> ServerRoot "F:/Program Files/Apache" <br>
line 58: Listen 80 -> Listen 8080 <br>
line 218: ServerName www.example.com:80 -> ServerName www.example.com:8080 <br>
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></directory></directory></directory></directory>
<br>
# php5 support <br>
LoadModule php5_module "F:/Program Files/php/php5apache2_4.dll" <br>
PHPIniDir "F:\Program Files\php" <br>
AddType application/x-httpd-php .php .html .htm <br>
# configure thepath to php.ini <br>
PHP
Download
找到下载链接,下载压缩包;F:\Program Files\php
中;F:\Program Files\php
目录,将 php.ini-development
重命名为 php.ini
,并用编辑器打开这个文件。修改如下部分: <br>
line 736: extension_dir = "ext" -> extension_dir = "F:/Program Files/php/ext" <br>
line 807: upload_tmp_dir = -> upload_tmp_dir = "/upload-files" <br>
line 881: ;extension=php_curl.dll -> extension=php_curl.dll <br>
line 883: ;extension=php_gd2.dll -> extension=php_gd2.dll <br>
line 890: ;extension=php_mbstring.dll -> extension=php_mbstring.dll <br>
line 892: ;extension=php_mysql.dll -> extension=php_mysql.dll <br>
line 895: ;extension=php_openssl.dll -> extension=php_openssl.dll <br>
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>
line 892
后添加: extension=php_mysqli.dll
Download页面
,下载对应系统和PHP版本的dll文件;F:\Program Files\php\ext
中;php.ini
,在文件末尾添加如下内容: <br>
[XDebug] <br>
zend_extension = "F:\Program Files\php\ext\php_xdebug-2.3.3-5.6-vc11-x86_64.dll" <br>
xdebug.profiler_append = 0 <br>
xdebug.profiler_enable = 1 <br>
xdebug.profiler_enable_trigger = 0 <br>
xdebug.profiler_output_dir = "F:\Program Files\php\xdebug" <br>
xdebug.profiler_output_name = "cachegrind.out.%t-%s" <br>
xdebug.remote_enable = 1 <br>
xdebug.remote_handler = "dbgp" <br>
xdebug.remote_host = "127.0.0.1" <br>
xdebug.trace_output_dir = "F:\Program Files\php\xdebug" <br>
至此,配置完成。MySQL太简单,就不写了。
以上就介绍了Apache&PHP+Xdebug 安装配置,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。