简体   繁体   English

wamp-xdebug配置未保存

[英]wamp - xdebug configuration is not getting saved

This is my xdebug configuration in my php.ini 这是我的php.ini中的xdebug配置

[xdebug]
zend_extension="C:\wamp64\bin\php\php5.6.35\zend_ext\php_xdebug-2.5.5-5.6-vc11-x86_64.dll"
xdebug.remote_log = C:\wamp64\logs\xdebug.log
xdebug.idekey = PHPSTORM
xdebug.remote_port = 9000
xdebug.remote_handler="dbgp"
xdebug.remote_autostart = on
xdebug.remote_start = on
xdebug.remote_enable = on
xdebug.remote_connect_back = on

it is at the very bottom of the file. 它位于文件的最底部。 As you can see, I have set the xdebug.idekey to PHPSTORM , but phpinfo() shows that the value is not set, what am I doing wrong? 如您所见,我已经将xdebug.idekey设置为PHPSTORM ,但是phpinfo()显示未设置该值,我在做什么错?

I also set the idekey through PhpStorm, but why is there no value entry in phpinfo() at the bottom? 我也通过PhpStorm设置了idekey,但是为什么在底部的phpinfo()中no value输入呢? The top one is filled ?! 最上面的一个填满了吗?

在此处输入图片说明

EDIT from comments and @Black's answer this is the answer : 编辑评论和@Black的答案,这就是答案:

WAMP use 3 PHP.ini files : WAMP使用3个PHP.ini文件:

  • Apache's file : wamp\\bin\\apache\\apache[version]\\bin\\php.ini Apache的文件: wamp\\bin\\apache\\apache[version]\\bin\\php.ini
  • PHP's file : wamp\\bin\\php\\php[version]\\php.ini PHP的文件: wamp\\bin\\php\\php[version]\\php.ini
  • Third file : wamp\\bin\\php\\php[version]\\phpForApache.ini 第三个文件: wamp\\bin\\php\\php[version]\\phpForApache.ini

First two files are usefull, apache's file is used for HTTP calls, PHP's one for CGI/CLI. 前两个文件很有用,apache的文件用于HTTP调用,PHP的文件用于CGI / CLI。 The third one is used when your WAMP has 2 PHP's version, WAMP use it for saving the current config and then create a new PHP.ini file for the new version. 当WAMP具有2个PHP版本时,将使用第三个,WAMP使用它来保存当前配置,然后为新版本创建一个新的PHP.ini文件。 This happens during the switch of PHP's version. 这是在PHP版本切换期间发生的。

In the Xdebug's case, indeed it was the apache's file that matter. 在Xdebug的情况下,确实重要的是apache的文件。 It's a common issue when the phpinfo don't show any modifications. 当phpinfo不显示任何修改时,这是一个常见问题。

If you have the same configuration between those two files, you also can make a symlink from PHP's file to apache one. 如果在这两个文件之间具有相同的配置,则还可以从PHP的文件进行符号链接到apache。 This will save a lot of headache. 这将节省很多头痛。


UNLUCKY TRIES Depends on your request, you may want to configure your server with differents things. 不幸的事情根据您的要求,您可能需要为服务器配置其他功能。

You tried to use Xdebug as remote, then your IDEKEY should be SET as environment variable named : DBGP_IDEKEY 您尝试将Xdebug用作远程,然后将IDEKEY设置为名为: DBGP_IDEKEY环境变量。

Here's the doc : 这是文档:

xdebug.idekey xdebug.idekey

Type: string, Default value: complex Controls which IDE Key Xdebug should pass on to the DBGp debugger handler. 类型:字符串,默认值: 复杂控制将哪个IDE Key Xdebug传递给DBGp调试器处理程序。 The default is based on environment settings. 默认值基于环境设置。 First the environment setting DBGP_IDEKEY is consulted, then USER and as last USERNAME. 首先,请参考环境设置DBGP_IDEKEY,然后再查询USER,最后是USERNAME。 The default is set to the first environment variable that is found. 默认设置为找到的第一个环境变量。 If none could be found the setting has as default ''. 如果找不到,则该设置为默认值“”。 If this setting is set, it always overrides the environment variables. 如果设置了此设置,它将始终覆盖环境变量。

You may be concerned by conditions that I pointed out with italic text 您可能会对我用斜体字指出的条件感到担心

as linked in comment, take a look at the full documentation 如评论所链接,请查看完整文档

I remember that WAMP use Xdebug as an Thread safe extension, you should try to replace 我记得WAMP使用Xdebug作为线程安全扩展,您应该尝试替换

zend_extension="C:\\wamp64\\bin\\php\\php5.6.35\\zend_ext\\php_xdebug-2.5.5-5.6-vc11-x86_64.dll"

by 通过

zend_extension_ts="C:\wamp64\bin\php\php5.6.35\zend_ext\php_xdebug-2.5.5-5.6-vc11-x86_64.dll"

And check if you have download a correct version of Xdebug (Thread Safe) 并检查您是否下载了正确版本的Xdebug(线程安全)

Then restart wamp and see if something has changed. 然后重新启动wamp,看看是否有所更改。

EDIT : You have an issue with your PHP.ini, you're not modifying the right one. 编辑:您的PHP.ini有问题,您没有修改正确的问题。 I succeeded on mine with this : 我成功做到了这一点:

; XDEBUG Extension zend_extension = "C:\wamp\bin\php\php7.0.4\zend_ext\php_xdebug-2.4.0-7.0-vc14-x86_64.dll" ; 

[xdebug] 
xdebug.remote_enable=1 
xdebug.idekey = "PHPSTORM" 
xdebug.remote_autostart= on 
xdebug.remote_connect_back= 1 
xdebug.remote_host="127.0.0.1" 
xdebug.remote_port=9000 
xdebug.remote_handler="dbgp" 
xdebug.remote_mode=req 
xdebug.profiler_enable = 0 
xdebug.profiler_output_dir = "c:/wamp/tmp/" 
xdebug.collect_params = On 
xdebug.show_local_vars = On`

这就是我得到的

The reason why it was not saved is that on wamp you have to store your config in C:\\wamp64\\bin\\apache\\apache_VERSION\\bin\\php.ini instead of C:\\wamp64\\bin\\php\\php_VERSION\\php.ini . 未保存该文件的原因是在wamp您必须将配置存储在C:\\wamp64\\bin\\apache\\apache_VERSION\\bin\\php.ini而不是C:\\wamp64\\bin\\php\\php_VERSION\\php.ini

I searched my whole wamp/bin/php folder for the occurence of the string xdebug by using Notepad++, thats how I found it out. 我使用记事本++在整个wamp/bin/php文件夹中搜索了字符串xdebug的出现,这就是我发现它的方式。

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

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