phpstorm没有看到xdebug,但已安装 [英] Phpstorm does not see xdebug but it is installed

查看:141
本文介绍了phpstorm没有看到xdebug,但已安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

PhpStorm无法看到xdebug,但已安装.在我的浏览器中,xdebug可以正常工作.问题出在哪里?

PhpStorm cannot see xdebug but it is installed. In my browser xdebug works fine. Where is the problem?

错误:

与"xdebug"的连接未建立.验证安装.

Connection with 'xdebug' was not established. Validate installation.

php.ini

[xdebug]
xdebug.idekey=PHPSTORM
zend_extension="/Applications/MAMP/bin/php/php5.4.10/lib/php/extensions/no-debug-non-zts-20100525/xdebug.so"
xdebug.default_enable=1
xdebug.coverage_enable=1
xdebug.profiler_enable = 1
xdebug.profiler_output_dir = "/tmp"
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.remote_autostart=1

phpstorm中的

phpinfo:

phpinfo in phpstorm:

PHP版本:5.4.10

PHP version: 5.4.10

Loaded extensions:  bcmath, bz2, calendar, Core, ctype, curl, date, dom, ereg, exif, fileinfo, filter, ftp, gd, gettext, hash, iconv, imap, json, ldap, libxml, mbstring, mcrypt, mysql, mysqli, openssl, pcre, PDO, pdo_mysql, pdo_pgsql, pdo_sqlite, pgsql, Phar, posix, Reflection, session, SimpleXML, soap, sockets, SPL, sqlite3, standard, tokenizer, XCache, xml, xmlreader, xmlwriter, xsl, yaz, zip, zlib

推荐答案

首先,您要使用MAMP(免费)还是MAMP Pro?

First, are you using MAMP (free) or MAMP Pro?

结果表明,您从MAMP中编辑的php.ini文件与PhpStorm在解释器中使用的php.ini文件之间存在差异.

Turns out there is a difference between the php.ini file you edit from MAMP and the php.ini file that PhpStorm uses in the interpreter.

MAMP Pro php.ini文件位于/Library/Application Support/appsolute/MAMP PRO/conf/php.ini中,并且没有PHP安装(设置解释器时PhpStorm需要此文件).如果您运行phpinfo();这是您将从中查看数据的文件.

The MAMP Pro php.ini file resides in /Library/Application Support/appsolute/MAMP PRO/conf/php.ini and doesn't have a PHP installation (which PhpStorm needs when setting the interpreter). If you run phpinfo(); this is the file you will see data from.

将PhpStorm设置到此处的必需位置/Applications/MAMP/bin/php/php5.4.x/bin时,它将查找那里的php.ini文件,而不是MAMP Pro使用的文件(上面).因此,如果您希望PhpStorm查看调试器,则需要将代码添加到该php.ini文件中.

When you set PhpStorm to the necessary location here /Applications/MAMP/bin/php/php5.4.x/bin it looks at the php.ini file there, not the one that MAMP Pro uses (above). So if you want PhpStorm to see the debugger, you need to add the code to that php.ini file.

有关为MAMP和PhpStorm设置解释器的帮助,请参考此处的文档

For help setting up the interpreter for MAMP and PhpStorm refer to the documentation here

有用的提示::在检查是否已安装xdebug时,请确保从MAMP php位置的终端中运行--version命令.否则,您最终将看到默认的OSX PHP信息,默认情况下未安装xdebug.

HELPFUL HINT: When checking to see if xdebug is installed make sure to run the --version command in terminal from the MAMP php location. Otherwise you'll end up seeing the default OSX PHP info which wouldn't have xdebug installed by default.

示例:在PhpStorm终端中运行此命令以查看其是否有效/Applications/Mamp/bin/php/php5.4.4/bin/php --version

Example: run this in the PhpStorm terminal to see if it works /Applications/Mamp/bin/php/php5.4.4/bin/php --version

这篇关于phpstorm没有看到xdebug,但已安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆