Home  >  Article  >  Backend Development  >  远道调试php

远道调试php

WBOY
WBOYOriginal
2016-06-13 13:04:22866browse

远程调试php

首先得确保服务器正确安装了zend debugger。可以用phpinfo查看。并且在服务器的根目录下有dummy.php文件。此外,还需要更改服务器的php.ini,将里面的

?

zend_debugger.allow_hosts=127.0.0.1
zend_debugger.expose_remotely=always

更改为

zend_debugger.allow_hosts=127.0.0.1,192.168.0.102
zend_debugger.expose_remotely=always

?

这里的新加的ip地址是客户端的ip地址,并且要保证两个机器是ping的通的,把防火墙什么的关掉。这里会使用zend debugger的专用端口号进行传输。

?

接着我们使用aptana作为调试工具。我的aptana是装好了pdt还有zend debugger plugin的。

首先打开preference,在php server里面新建一个服务器,地址就写服务器的地址,比如说是http://192.168.0.101。

再选中一个php页面,右键有一个debug as选项,选中debug configuration,在php server那一栏选择刚才新建的,再点击php server的configure。里面有一个path mapping。第一栏写服务器的要被调试的文件的所在文件夹,比如说是d:/debugtest/,注意,这个路径是服务器的路径,不要填成自己的。下面选择自己的工作空间的对应的文件夹。要保证两个目录是对应的,而且代码也应该是一样的。

接着就debug吧。把url调好,如果不成功就把url地址后面的debughost的值改成192.168.0.102。再刷新一下,应该就可以调试了。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn