安装wampserver后,同时在apache2.4.23\bin\PHP.ini 和 php\php5.6.25\php.ini 文件最末尾新增:
[xdebug]
zend_extension ="c:/wamp/bin/php/php5.6.25/zend_ext/php_xdebug-2.4.1-5.6-vc11.dll"
xdebug.remote_enable = 1
xdebug.remote_handler = "dbgp"
xdebug.remote_host = "localhost"
xdebug.remote_mode = "req"
xdebug.remote_port = 9000
xdebug.idekey="PHPSTORM"
xdebug.remote_cookie_expire_time = 7200
– PS:标点符号 –
具体详解
下载 xdebug (phpstorm-2016.03 __ wampserver-3.0.6-64bit)
安装扩展
i. 在php.ini文件尾部写入,文章前面的代码内容(ps:标点符号)
ii. 查看phpinfo(),是否有 安装成功
phpStorm 设置
i. file -> setting -> Language and framework -> php -> debug (or : 进入setting 界面后,直接搜索 xdebug)
这里的debug port要和php.ini里面的xdebug.remote_port相一致!默认是9000,如果9000端口被占用的话,可以改成其他端口。
ii. 客户端调试,进入File>Settings>PHP>Servers,这里要填写服务器端的相关信息,name填localhost,host填localhost,port填80,debugger选XDebug
iii. 进入File>Settings>PHP>Debug,看到XDebug选项卡,port填9000,其他默认
iv. 进入File>Settings>PHP>Debug>DBGp Proxy,IDE key 填 phpStorm,host 填localhost,port 填80
点OK退出设置。
其它参见