1.安装debug 2.检查phpinfo是否存在xdebug 3.修改/etc/php5/apache2/conf.d/xdebug.ini 内容如下: [xdebug] zend_extension=”/usr/lib/php5/20090626/xdebug.so” xdebug.idekey=”PHPSTORM” xdebug.remote_host=127.0.0.1 xdebug.remote_enable=on xdebug.remote_port = 9000 xdebug.remote_handler = “dbgp” xdebug.auto_trace = 1 xdebug.collect_includes = 1 xdebug.collect_params = 1 xdebug.collect_return = 1 xdebug.default_enable = 1 xdebug.collect_assignments = 1 xdebug.collect_vars = 1 xdebug.remote_autostart = 1 xdebug.remote_connect_back = 1 xdebug.show_local_vars = 1 xdebug.show_exception_trace = 0
4.PHPStorm设置 php-servers中设置name:localhost,host:localhost,port:80,debugger:xdebug php-debug中设置端口为9000 php-debug-dbgp proxy中这是IDE key:PHPSTORM host:设置localhost 5.如果是框架需要配置 菜单run-edit debug configurations-defaults-PHP web Application中设置 server:localhost Start URL:这里填写你要调试的路径地址 参考网址:http://www.crazyphper.com/?p=2860