How to add XDebug zend_extension to php.ini?

风格不统一 提交于 2019-12-11 12:35:38

问题


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.

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.

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"

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

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

To php.ini? I see three ways of doing it and I don't know which is correct:

  1. I could add it to the comma separated list in WHM
  2. I could add it in php.ini directly, putting a comma between it and the existing value
  3. I could put it on a new line in php.ini

Which way is correct?


回答1:


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

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

Notice the alphabetical order as well.



来源:https://stackoverflow.com/questions/24657939/how-to-add-xdebug-zend-extension-to-php-ini

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!