Sup*_*ent 2 php xdebug ubuntu-14.04
我一直抛出此错误,但是我安装了版本7.1.2。我为什么不能./configure
这是我的错误信息:
checking whether to enable Xdebug support... yes, shared
checking Check for supported PHP versions... configure: error: not supported.
Need a PHP version >= 7.0.0 and < 7.3.0 (found 5.3.10-1ubuntu3.26)
root@precise32:/var/www/xdebug# php -v
PHP 7.1.2-3+deb.sury.org~precise+1 (cli) (built: Feb 22 2017 10:29:40) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.1.2-3+deb.sury.org~precise+1, Copyright (c) 1999-2017, by Zend Technologies
root@precise32:/var/www/xdebug#
Run Code Online (Sandbox Code Playgroud)
有没有其他人遇到这个问题。我尝试过重新安装php 7.0和其他一些策略。通读一堆类似的不同堆栈问题,但我无法弄清楚。
这意味着我无法继续: make
make install
cp modules/xdebug.so /etc/php.d/xdebug.so
Run Code Online (Sandbox Code Playgroud)
您正在使用Ond?ejSurý的PPA。因此,您可以使用轻松安装xdebug apt-get install php7.1-xdebug。
编辑:如何配置Xdebug(在基于Ubuntu的Linux系统上):
创建一个ini文件/etc/php/7.1/mods-available/custom.ini,并将以下配置放入其中:
; priority=90
[xdebug]
xdebug.remote_enable=1
; replace <Host-IP-Address> with the IP of your host system!
xdebug.remote_host=<Host-IP-Address>
; You'll need this later.
xdebug.idekey=PHPSTORM
xdebug.profiler_enable_trigger=1
Run Code Online (Sandbox Code Playgroud)
现在,使用命令激活配置sudo phpenmod -v 7.1 -s ALL custom。不要忘记重新启动您的Web服务器。
其次,您需要一个支持dbgp协议的IDE 。我使用的是PhpStorm,它运行速度很快(甚至可以运行数小时),并且具有本地Xdebug支持。
设置IDE并在代码中设置至少一个断点后,可以非常简单地触发调试器:
第一个选项:添加查询参数XDEBUG_SESSION_START=PHPSTORM(其中PHPSTORM是xdebug.idekey配置文件中设置的值)。
第二个选择:发送XDEBUG_SESSION=PHPSTORM包含您请求内容的cookie 。cURL示例:curl -H 'Cookie: XDEBUBG_SESSION=PHPSTORM' http://my-awesome.domain/awesome-script.php。
如果设置正确,则可以使用Xdebug。
Xdebug- 文档
PhpStorm- 配置Xdebug
PhpStorm- 使用Xdebug和PhpStorm进行零配置Web应用程序调试
最后但并非最不重要的一点,是一些不错的Xdebug设置:
; enable colors for the command-line interface
xdebug.cli_color=1
; show more data when using var_dump
xdebug.max_nesting_level=500
xdebug.var_display_max_children=512
xdebug.var_display_max_data=2560
xdebug.var_display_max_depth=200
; enable trigger for easy profiling
xdebug.profiler_enable_trigger=1
Run Code Online (Sandbox Code Playgroud)
进行良好的调试:)
| 归档时间: |
|
| 查看次数: |
1060 次 |
| 最近记录: |