解析phpstorm + xdebug 远程断点调试

yipeiwu_com6年前PHP代码库
XDEBUG配置:
1.安装 xdebug 略了。网上有很多资料。
重点写php.ini的配置
[XDebug]
复制代码 代码如下:

zend_extension="/usr/lib/php5/20090626+lfs/xdebug.so"
xdebug.default_enable = On
xdebug.collect_params = On
xdebug.remote_connect_back = On           //如果开启此,将忽略下面的 xdebug.remote_host 的参数。 <一台webserver有多个开发者的工作目录的时候使用,如:p1.xx.com,p2.xx.com,p3.xx.com 。。。等。 >
xdebug.remote_host = 192.168.59.104    //注意这里是,客户端的ip<即IDE的机器的ip,不是你的web server>
xdebug.remote_port = 9900                       //      注意这里是,客户端的端口<即IDE的机器的ip,不是你的web server>
xdebug.remote_enable = On
xdebug.remote_handler = dbgp
xdebug.remote_log = "/var/www/xdebug/xdebug.log"
 xdebug.remote_req = req
 xdebug.auto_trace = Off
 xdebug.remote_autostart = On
 xdebug.show_exception_trace = 0
 xdebug.collect_vars = On
 xdebug.collect_return = On
 xdebug.collect_params = On
 xdebug.var_display_max_depth = 15
 xdebug.show_local_vars = 1
 xdebug.dump_undefined = 1
 xdebug.profiler_enable = 1
 xdebug.profiler_output_dir = /var/www/xdebug

PHPSTORM 配置:
1.file->setings->php|Debug右侧。xdebug的那一块。 设置Debug port:9900(这里设置 的是,xdebug 吐出的debug信息,通过本机的什么端口传输。)
2.file->setings->php|Servers  右侧。  host: 你的web服务器的域名或ip ,端口,  下面的 use path mapping  意的是,你的项目的目录,对应服务器上的,什么目录?   这里一定要设置哦! 不然,会发生找不到文件而出错,导至调试终止。
3.Run->Edit Configurations-> 增加一个 PHP WEB APPlication 的调试点。  右侧: server 选择你上面建立的server.  starturl 设置你的入口文件。
至此,配置完毕!
这样的请求,可以注册一个调试客户端哦!
http://www.aihuxi.com/****.php?XDEBUG_SESSION_START=19192
点击,小虫子图标,即可,开始调试!

相关文章

PHP中使用数组实现堆栈数据结构的代码

在堆栈中,最后压入的数据(进栈),将会被最先弹出(出栈)。 即在数据存储时采用“先进后出”的数据结构。 PHP中,将数组当做一个栈,主要是使用array_push()和array_pop...

深入解析PHP垃圾回收机制对内存泄露的处理

上次说到了refcount和is_ref,这里来说说内存泄露的情况复制代码 代码如下:$a = array(1, 2, &$a);unset($a);在老的PHP版本中,这里就会出现内存...

PHP使用finfo_file()函数检测上传图片类型的实现方法

本文实例讲述了PHP使用finfo_file()函数检测上传图片类型的实现方法。分享给大家供大家参考,具体如下: 在输入输出中,文件的交互必不可少,比如文件的上传什么的。这里我们来解决一...

php通用检测函数集合第1/3页

<?  //【警告】:未经许可请勿随便修改  //-------------------------------------------------------...

PHP中的strtr函数使用介绍(str_replace)

strtr 有两种形式: string strtr ( string $str , string $from , string $to ) string strtr ( string $...