本文共 594 字,大约阅读时间需要 1 分钟。
zend studio调试php程序有两种方式,debugger跟xdebug。我用的xdebug,环境配置完成后,手动设置断点无效,每次调试都在代码第一行停住。
当然这是因为勾选了break at first line的原因:
如果没有勾选这个,调试无反应。首先检查php.ini中的xdebug配置,
xdebug.remote_host=192.168.1.103xdebug.remote_port=9000
IP地址和端口均正确,检查zend studio–>window–>preference–>debug下配置也正确,端口也是9000。再检查debug server段的配置,没有问题。
接着检查Path mapping时,发现问题:
其中的path on server的路径一定要填写你的调试文件所在的完整目录,比如apache的发布目录是d:www,调试文件是d:wwwwampwpsourceindex.php,那个这个path on server就要填写wampwpsource,如果填写有问题,就会出现断点设置无效的问题。当然断点无效还有别的原因,如果解决不了,欢迎一起讨论学习。
也就是说:Path Mapping里面的Path on server要设置相对路径,比如/htdocs,然后Local Path设置本地对应的路径,如D:\xampp\htdocs
转载地址:http://uuzli.baihongyu.com/