Ubuntu+phpstorm+firefox+xdebug的配置

发布时间:2019-08-07 发布网站:脚本宝典
脚本宝典收集整理的这篇文章主要介绍了Ubuntu+phpstorm+firefox+xdebug的配置脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
本机使用ubuntu14.04,phpstorm 2017.1, php5.5.9
需要使用的软件和依赖: php5, php5-dev, php5-cgi, php5-xdebug
apache, php请记得安装

1.安装apache

安装完成后,配置ServerName
位置在/etc/apache2/sITes-available/000-default.conf
找到后,用Vim更改:

ServerName 127.0.0.1

Ubuntu+phpstorm+firefox+xdebug的配置

2.安装php5

安装完成,获取php信息:

php-i > “info.txt

3.安装phpstorm

将info.txt里面的信息复制到https://xdebug.org/wizard.php
按照网站给与的提示一步步安装

4.安装xdebug

在firefox,下面简称ff,菜单-附加组件-获取附加组件-搜索'xdebug',然后安装

Ubuntu+phpstorm+firefox+xdebug的配置

5.配置php5

在apache根目录(默认为/VAR/www/htML/)写一个php文件info.php,代码为

<?php
    phpinfo();

访问localhost/info.php

Ubuntu+phpstorm+firefox+xdebug的配置

看到配置文件所在位置为:

/etc/php5/apache2/php.ini

在Php.ini文件末尾增加以下配置:

[Xdebug]
zend_extension = /usr/lib/php5/20121212/xdebug.so
xdebug.idekey = "PHPSTORM"
xdebug.auto_trace = on
xdebug.default_enable = on
xdebug.auto_PRofile = on
xdebug.collect_params = on
xdebug.collect_return = on
xdebug.profiler_enable = on
xdebug.remote_enable = 1
xdebug.remote_host = localhost
xdebug.remote_port = 9000
xdebug.remote_handler = dbgp
xdebug.remote_connect_back = 1
xdebug.trace_output_dir = "/usr/local/php/xdebug/"
xdebug.profiler_output_dir = "/usr/local/php/xdebug/"

重启apache:

sudo service apache2 restart

打开info.php,看到有xdebug的配置信息:

Ubuntu+phpstorm+firefox+xdebug的配置

6.配置phpstorm

File– Settings - Languages &amp; Frameworks

  • PHP

Ubuntu+phpstorm+firefox+xdebug的配置

  • PHP– Debug – Xdebug:

Debugport: 9000

Ubuntu+phpstorm+firefox+xdebug的配置

Ubuntu+phpstorm+firefox+xdebug的配置

  • Servers:

Ubuntu+phpstorm+firefox+xdebug的配置

Ubuntu+phpstorm+firefox+xdebug的配置

Ubuntu+phpstorm+firefox+xdebug的配置

7.配置完成,开始使用

  • 打开phpStorm的小话图标

Ubuntu+phpstorm+firefox+xdebug的配置

  • 打开ff的小瓢虫图标

Ubuntu+phpstorm+firefox+xdebug的配置

  • 在php文件某行设置断点

Ubuntu+phpstorm+firefox+xdebug的配置

  • 在浏览器访问该php文件

Ubuntu+phpstorm+firefox+xdebug的配置

  • 就有断点效果了

Ubuntu+phpstorm+firefox+xdebug的配置

脚本宝典总结

以上是脚本宝典为你收集整理的Ubuntu+phpstorm+firefox+xdebug的配置全部内容,希望文章能够帮你解决Ubuntu+phpstorm+firefox+xdebug的配置所遇到的问题。

如果觉得脚本宝典网站内容还不错,欢迎将脚本宝典推荐好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。