加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > PHP教程 > 正文

Phpstorm没有看到xdebug,但是它已被安装

发布时间:2020-12-13 22:39:55 所属栏目:PHP教程 来源:网络整理
导读:PhpStorm看不到xdebug,但是它已被安装.在我的浏览器中,xdebug工作正常.哪里有问题? 错误: Connection with ‘xdebug’ was not established. Validate installation. php.ini中 [xdebug]xdebug.idekey=PHPSTORMzend_extension="/Applications/MAMP/bin/php
PhpStorm看不到xdebug,但是它已被安装.在我的浏览器中,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

phpinfo中的phpinfo

PHP版本: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?

原来,您从MAMP编辑的php.ini文件与PhpStorm在解释器中使用的php.ini文件之间有区别.

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

当您将PhpStorm设置为必需的位置时/Applications/MAMP/bin/php/php5.4.x/bin它会查看php.ini文件,而不是MAMP Pro使用的(上).所以如果你想让PhpStorm看到调试器,你需要添加代码到php.ini文件.

有关为MAMP和PhpStorm设置解释器的帮助,请参阅documentation here

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

示例:在PhpStorm终端中运行它,看看它是否有效/Applications/Mamp/bin/php/php5.4.4/bin/php –version

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读