如何将 XDebug zend_extension 添加到 php.ini? [英] How to add XDebug zend_extension to php.ini?
问题描述
我有一个带有 cPanel WHM 的 VPS,并且正在尝试启用 XDebug.我通过转到 WHM -> 安装了扩展程序.软件 ->模块安装程序 ->PHP Pecl ->管理
,我通过检查我的 phpinfo()
页面确认它已安装.
I have a VPS with cPanel WHM and am trying to enable XDebug. I installed the extension by going to WHM -> Software -> Module Installers -> PHP Pecl -> Manage
and I confirmed it's installed by checking my phpinfo()
page.
下一步是在我的 php.ini 文件中启用 XDebug,但我有点困惑我应该如何去做.
The next step is to enable XDebug in my php.ini file, but I'm a little confused how I should go about doing this.
查看/usr/local/lib
中的php.ini,我在底部看到这一行:
Looking at php.ini in /usr/local/lib
, I see this line at the bottom:
zend_extension="/usr/local/Zend/lib/Guard-6.0.0/php-5.4.x/ZendGuardLoader.so"
然而,在 WHM -> 服务配置 -> PHP 配置编辑器中,有一个带有这个值的zend_extension"选项:
However, in WHM -> Service Configuration -> PHP Configuration Editor, there's a "zend_extension" option with this value:
/usr/local/IonCube/ioncube_loader_lin_5.4.so, /usr/local/Zend/lib/Guard-6.0.0/php-5.4.x/ZendGuardLoader.so
所以我的问题是,我应该如何添加 XDebug 的路径:
So my question is, how should I go about adding the path to XDebug:
/usr/local/lib/php/extensions/no-debug-non-zts-20100525/xdebug.so
到php.ini?我看到了三种方法,但我不知道哪个是正确的:
To php.ini? I see three ways of doing it and I don't know which is correct:
- 我可以将它添加到 WHM 中的逗号分隔列表中
- 我可以直接将它添加到 php.ini 中,在它和现有值之间加一个逗号
- 我可以把它放在 php.ini 中的一个新行
哪种方式是正确的?
推荐答案
高度依赖于 PHP 配置 (./configure
).PHP 将查找您的 xdebug.so
扩展的默认扩展路径;在这种情况下,您不需要指定任何路径:
Highly depends on the PHP configuration (./configure
). PHP will look in the default extension path for your xdebug.so
extension; in which case you don't need to specify any path:
zend_extension = xdebug.so
关于换行和逗号,我更喜欢换行,因为这样可以更轻松地以后删除扩展名.我的 php.ini
看起来像这样(示例):
Regarding new line and comma, I prefer new line because it makes it easier to remove an extension later on. My php.ini
looks like this (example):
extension = memcached.so
extension = zopfli.so
zend_extension = opcache.so
zend_extension = xdebug.so
注意字母顺序.
这篇关于如何将 XDebug zend_extension 添加到 php.ini?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!