Home  >  Article  >  Backend Development  >  配置 Phpstorm + Xdebug + xampp

配置 Phpstorm + Xdebug + xampp

WBOY
WBOYOriginal
2016-06-23 13:30:16925browse

配置 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是你的项目的入口)。

版权声明:本文为博主原创文章,未经博主允许不得转载。

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