我能够在PHPStorm中设置一个php web app调试器,只需将它绑定到我在特定端口的localhost即可,一切正常.但是要实现这一点,我需要先在shell上运行此命令:
php app/console server:run --env=dev
Run Code Online (Sandbox Code Playgroud)
如果我设置断点来浏览网站本身或测试来自基于浏览器的休息客户端(如邮递员)的 api调用,这样就可以了
但是,我正在尝试为我的移动应用程序设置断点(移动应用程序将http调用发送到后端应用程序,这是一个symfony应用程序).使用Web应用程序配置不适用于此配置.
使用本教程,我能够将上述命令行合并到PHPStorm中,所以现在我可以使用phpstorm命令行工具实际运行代码.
我的问题是:如何将调试器实际绑定到PHPStorm中的命令行?现在,当我在PHPStorm中创建内置Web服务器时,它默认使用默认的php解释器(即如果我使用内置的Web服务器运行代码..我在PHPStorm的控制台中看到了这一点:
/usr/local/Cellar/php54/5.4.28/bin/php -S localhost:8000 -t /project/root/directory
Run Code Online (Sandbox Code Playgroud)
我想要的是这样的:
php app/console server:run --env=dev -S localhost:8000 -t /project/root/directory
Run Code Online (Sandbox Code Playgroud)
知道怎么做吗?
首先要做的事情:
重要:XDebug也在Apache和我的Win7防火墙上正确配置.我知道b/c我可以使用Eclipse进行调试.
所以我失败的似乎是PHPStorm的基本配置.
让我来介绍一些细节:
我要调试的文件是index.php:
无论我拼凑什么......我得到了一些错误消息,比如"等待来自JetBrains PhpStorm的连接..."或者PHPStorm要求我提供Mozillas profile.ini,即使我在网页浏览器中将Chrome配置为默认值.
所以我将建立一个新项目,希望有人告诉我我的配置有什么问题.
运行/编辑配置/默认值/ PHP远程调试:
服务器:
C:\ dev\sf\Symfony =>/mnt/hgfs/sf/Symfony(也试过/ Symfony - b/c PHPStorm不应该关心/ Symfony上面的任何东西!?)
运行/编辑配置/默认值/ PHP Web应用程序:
现在我选择:Run/Debug .../1.index.php
我被问到:Mozilla的profile.ini ......但我找不到它
它在哪里 ... ?
到目前为止,我已经开始使用PHPStorm启动Chrome了.但也许我先解决这个问题.那么如何让Firefox运行起来呢?我也使用Firefox与Eclipse ...没有问一个profile.ini的问题.
我不能让XDebug在Windows 7机器上与PhpStorm和Vagrant合作.我已经按照每个教程来完成这项工作,但没有运气.
所以我试过的是:
zend_extension = "..../xdebug.so"
xdebug.remote_enable= 1
xdebug.remote_handler=dbgp
xdebug.remote_host= 33.33.33.10
xdebug.remote_port= 9000
xdebug.remote_connect_back= 1
xdebug.remote_autostart= 1
xdebug.remote_log = "...."
Run Code Online (Sandbox Code Playgroud)
localhost:8080太33.33.33.10,既没有运气.I: Checking remote connect back address.
W: Remote address not found, connecting to configured address/port: 33.33.33.10:9000. :-|
E: Could not connect to client. :-(
Run Code Online (Sandbox Code Playgroud)
我只是不知道该怎么做,但我真的需要能够调试.
谢谢你的帮助!
我正在使用PHPStorm来开发我的PHP网页.我的Apache服务器,XDebug和一个简单的Web PHP项目都可以正常工作.没问题.
但是,当我尝试使用调试Laravel 5.1 Web项目时php artisan serve,我无法调试断点.这就像php artisan serve使用另一台服务器......
在我的PHPStorm上,我总是看到:
等待与ide键'(randomNumberHere)'的传入连接
我已经在PHPStorm中配置了所有内容(启用远程调试,正确的端口等),并且使用"普通"PHP项目一切正常.
有人可以告诉我,我是否需要改变一些东西?
谢谢!
我正在尝试设置Xdebug因为我厌倦了使用回声和var_dumps.我使用Atom作为我的IDE与php-debug插件.我正在使用laravel Homestead vm作为服务器.转发端口9000到9999 Atom安装了插件,其中包含以下设置:

我在Atom中设置断点,我浏览到我的页面,但断点不会触发.我有预感它与IDE密钥有关,但我不知道如何继续.

有没有人知道原子的IDE键?或者还有其他我想念的东西?
编辑:我已将以下内容添加到xdebug.ini:
xdebug.auto_trace = 0
xdebug.collect_includes = 1
xdebug.collect_params = 1
xdebug.collect_return = 0
xdebug.collect_vars = "Off"
xdebug.default_enable = "On"
xdebug.dump.COOKIE = ""
xdebug.dump.FILES = ""
xdebug.dump.GET = ""
xdebug.dump.POST = ""
xdebug.dump.REQUEST = ""
xdebug.dump.SERVER = ""
xdebug.dump.SESSION = ""
xdebug.dump_globals = 1
xdebug.dump_once = 1
xdebug.dump_undefined = 0
xdebug.extended_info = 1
xdebug.file_link_format = ""
xdebug.idekey = "VVVDEBUG"
xdebug.manual_url = "http://www.php.net"
xdebug.max_nesting_level = 100
xdebug.overload_var_dump = 1
xdebug.profiler_append = 0
xdebug.profiler_enable = …Run Code Online (Sandbox Code Playgroud) 将Ubuntu从14.04升级到16.04后,PHP CLI开始抱怨xdebug:
$ php -v
Cannot load Xdebug - it was already loaded
PHP 7.0.13-0ubuntu0.16.04.1 (cli) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
with Zend OPcache v7.0.13-0ubuntu0.16.04.1, Copyright (c) 1999-2016, by Zend Technologies
with Xdebug v2.4.0, Copyright (c) 2002-2016, by Derick Rethans
Run Code Online (Sandbox Code Playgroud)
只有一个.ini文件:
$ ls -la /etc/php/7.0/cli/conf.d/ | grep xdebug
lrwxrwxrwx 1 root root 38 Jan 19 11:41 20-xdebug.ini -> /etc/php/7.0/mods-available/xdebug.ini
Run Code Online (Sandbox Code Playgroud)
它只在以下输出中引用一次php -i:
$ php -i | grep …Run Code Online (Sandbox Code Playgroud) 我尝试在MacOs Mojave上安装xdebug但是得到了这个错误
/private/tmp/pear/install/xdebug/xdebug.c:25:10: fatal error: 'php.h' file not found
Run Code Online (Sandbox Code Playgroud)
命令行工具已安装.
我在 Xdebug v2 之前使用过,但在上次更新后我遇到了 Xdebug v3.0.0,我替换了更新用户指南所需的所有内容
我正在使用 Docker。
我的调试配置
#xdebug.remote_enable=true
xdebug.mode=debug
#xdebug.remote_port=9000
xdebug.client_port=9000
xdebug.remote_host=172.17.0.1
xdebug.remote_handler=dbgp
#xdebug.remote_autostart=1
xdebug.start_with_request=yes
#xdebug.remote_connect_back=0
xdebug.discover_client_host=0
xdebug.idekey=PHPSTORM
xdebug.show_error_trace = 1
xdebug.max_nesting_level=250
xdebug.var_display_max_depth=10
#xdebug.remote_mode=req
xdebug.remote_log=/var/log/r_xdebug.log
xdebug.log=/var/log/xdebug.log
Run Code Online (Sandbox Code Playgroud)
以及我在尝试执行任何 PHP 脚本时得到的日志:
tail -f /var/log/xdebug.log
[888] Log opened at 2020-11-29 10:39:51.670762
[888] [Step Debug] INFO: Connecting to configured address/port: localhost:9000.
[888] [Step Debug] WARN: Creating socket for 'localhost:9000', poll success, but error: Operation now in progress (29).
[888] [Step Debug] WARN: Creating socket for 'localhost:9000', connect: Cannot assign requested …Run Code Online (Sandbox Code Playgroud) 我在apache上运行php.我已经下载了我认为正确的xdebug编译的dll for php version 5.4 64 bit windows.我启用了线程安全,它使用的是VC9.我已经下载了dll并将其放在这里:
C:\php5\extras\php_xdebug-2.2.0RC1-5.4-vc9-x86_64.dll
Run Code Online (Sandbox Code Playgroud)
这是我在php.ini中的内容:
[xdebug]
zend_extension = "C:\php5\extras\php_xdebug-2.2.0RC1-5.4-vc9-x86_64.dll"
Run Code Online (Sandbox Code Playgroud)
当我启动Apache时,我收到此错误:
[Wed Apr 04 17:01:56 2012] [notice] Parent: Received restart signal -- Restarting the server.
Failed loading C:\php5\extras\php_xdebug-2.2.0RC1-5.4-vc9-x86_64.dll
hild process is ending.
[Wed Apr 04 17:01:56 2012] [notice] Apache/2.2.22 (Win32) PHP/5.4.0 configured -- resuming normal operations
[Wed Apr 04 17:01:56 2012] [notice] Server built: Jan 28 2012 11:16:39
[Wed Apr 04 17:01:56 2012] [notice] Parent: Created child process 2120
[Wed Apr 04 17:01:57 2012] [notice] Child …Run Code Online (Sandbox Code Playgroud) 我试图在mamp pro上设置xdebug但没有成功.我在互联网上搜索,没有任何帮助我.
首先,我试图在php.ini中取消注释以下行:
的zend_extension = "/应用程序/ MAMP /斌/ PHP/php5.4.4/lib中/ PHP /分机/无调试非ZTS-20100525/xdebug.so"
接下来,我尝试了向导:http: //xdebug.org/wizard.php
接下来,我尝试将这些行添加到php.ini:
xdebug.default_enable = 1
xdebug.remote_enable = 1
xdebug.remote_handler = dbgp
xdebug.remote_host =本地主机
xdebug.remote_port = 9000
xdebug.remote_autostart = 1
什么都没有帮助.我在phpinfo中看不到xdebug.
MAMP PRO版本:2.1.1
PHP版本:PHP 5.4.4
谢谢!