简体   繁体   English

Xdebug 不适用于 PhpStorm - PHP 7.2.10、Ubuntu 18.04.01

[英]Xdebug not working on PhpStorm - PHP 7.2.10, Ubuntu 18.04.01

I was using Ubuntu 17.10 and everything worked.我使用的是 Ubuntu 17.10,一切正常。 However, after a update to Ubuntu version 18.04 along with a clean install I can no longer get my Xdebug to work properly.但是,在更新到 Ubuntu 18.04 版并进行全新安装后,我无法再让 Xdebug 正常工作。

I tried to implement solutions that I found at SO or other sites but none of them helped.我尝试实施我在 SO 或其他网站上找到的解决方案,但没有一个有帮助。

php -v php -v

PHP 7.2.10-0ubuntu0.18.04.1 (cli) (built: Sep 13 2018 13:45:02) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.2.10-0ubuntu0.18.04.1, Copyright (c) 1999-2018, by Zend Technologies
    with Xdebug v2.6.0, Copyright (c) 2002-2018, by Derick Rethans

Here is my configuration in php.ini这是我在 php.ini 中的配置

/etc/php/7.2/apache2/php.ini /etc/php/7.2/apache2/php.ini

(same with /etc/php/7.2/apache2/conf.d/20-xdebug.ini file) (与 /etc/php/7.2/apache2/conf.d/20-xdebug.ini 文件相同)

[XDebug]
zend_extension ="/usr/lib/php/20170718/xdebug.so"
xdebug.profiler_enable =On
xdebug.auto_trace=On
xdebug.remote_enable=On
xdebug.remote_host="localhost"
xdebug.remote_port=90000

Xdebug Chrome extension - ide key option Xdebug Chrome 扩展 - ide 键选项

(I cleaned previous cookie belongs to Eclipse) (我清理了以前属于Eclipse的cookie)

PHPSTORM

some lines of phpinfo();一些phpinfo();

PHP Version:   7.2.10-0ubuntu0.18.04.1
Loaded Configuration File:  /etc/php/7.2/apache2/php.ini
Additional .ini files parsed: /etc/php/7.2/apache2/conf.d/20-xdebug.ini
--xdebug--
Version:    2.6.0
IDE Key:    1
xdebug.remote_enable:   On

What is wrong with my setup?我的设置有什么问题? And what can I do to fix it?我能做些什么来解决它?

To check if the server runs xdebug you can place xdebug_break(); 要检查服务器是否运行xdebug,可以放置xdebug_break();。 inside your php code. 在您的PHP代码中。 This should "hard" pause your script after the call. 这应该在调用后“硬”暂停脚本。 If not, check your server config. 如果没有,请检查您的服务器配置。

Phpinfo() 显示值 1 而不是 PHPSTORM 预期的

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM