您的位置:首页 > 编程语言 > PHP开发

配置 Phpstorm + Xdebug + xampp

2015-07-23 15:06 531 查看

配置 Phpstorm + Xdebug + xampp

1 Xampp

安装好xampp,配置 httpd.conf
在xampp面板中


单击后会出现一些配置文件,httpd.conf位于第一个
将DocumentRoot 路径改为 "G:/PHP" (我的工作空间),以后项目就放在这个文件夹里。



配置 php.ini(打开方式如上)

在Windows 下的配置:(这些代码位于php.ini的最后,将原来的带;的代码覆盖成下面所提供的就可以,此时运行phpinfo()函数可以看到在配置中有Xdebug)
[XDebug]
zend_extension = "D:\XAMPP\php\ext\php_xdebug.dll"
xdebug.profiler_append = 0
xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = 0
xdebug.profiler_output_dir = "D:\XAMPP\tmp"
xdebug.profiler_output_name = "cachegrind.out.%t-%s"
xdebug.remote_enable = 0
xdebug.remote_handler = "dbgp"
xdebug.remote_port=9000
xdebug.remote_host = "127.0.0.1"
xdebug.trace_output_dir = "D:\XAMPP\tmp"
xdebug.idekey= PHPSTROM

2 PhpStorm

在File->settings中








如图所示配置setting中的4个地方,最后在图片所示的localhost位置单击(若没有在这里配置过,那么会没有内容显示)




单击editconfiguration,可以看到如下所示





单击左上角+符号,选择PHP Built-in Web Server,按如图所示配置,Document root 指你想运行项目的根目录。右侧的port可以填写8789等4位数,

现在就可以运行你的程序啦,如在网址中打,localhost:8789/index.php(假设你的根目录下的index.php是你的项目的入口)。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: