[xdebug-general] Re: Cannot load Xdebug - extension already loaded

From: David Favor <david[@]davidfavor.com>
Date: Fri, 01 Jul 2016 09:46:49 -0500

Tâm Trịnh wrote:
> I installed xdebug as instructed http://links.davidfavor.com/wf/click?upn=npdP0-2FMHcGNgMeleDP-2B5C5k9i-2BQxD1BgyGY1HetOwPPFaTG5NNyWND3bwPlGBNU2_jtnmG15-2F3EGMaBGA-2FbgtuifoSJXkftuI1GnwPxXERgvjm4r3hhhb1M3YTcas0O-2FXWMTUbWz8L2Ezm-2F-2Bku-2B0HpL4-2FwgxnACGKegxlWvVZxCu1Coz-2BqBBwjCo7YDtDuPtI9K6pIj9CM5bC8g2WycIuTFNVpSyq04M2vX0ZA-2Btc0VmAzwz0vOUsPbZ4zB1uyvJJs66G0VpxP4Qp1rxEu4O-2BO0xkb7PCCYKcD-2BsUrZS7L-2F0-3D , after
> restarting the web service error.
> [root[@]MyServer ~]# service php-fpm restart
> Stopping php-fpm: [ OK ]
> Starting php-fpm: Cannot load Xdebug - extension already loaded
>
> *Log of apache:*
> [Sat Jun 25 17:16:15 2016] [notice] Apache/2.2.22 (Unix) DAV/2
> PHP/5.6.22 SVN/1.6.11 configured -- resuming normal operations
> Failed loading /usr/lib64/php-zts/modules/xdebug.so:
> /usr/lib64/php-zts/modules/xdebug.so: undefined symbol: sapi_globals
>
>
> ======================
> *Info server:*
> [root[@]MyServer ~]# uname -a
> Linux MyServer 2.6.32-642.el6.x86_64 #1 SMP Tue May 10 17:27:01 UTC 2016
> x86_64 x86_64 x86_64 GNU/Linux
> ------------------------------------------------------------
> [root[@]MyServer ~]# php -v
> Cannot load Xdebug - extension already loaded
> PHP 5.6.22 (cli) (built: May 26 2016 15:44:55)
> Copyright (c) 1997-2016 The PHP Group
> Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
> with Xdebug v2.4.0, Copyright (c) 2002-2016, by Derick Rethans
> ------------------------------------------------------------
> Xdebug installed: no
> Server API: Apache 2.0 Handler
> Windows: no
> Zend Server: no
> PHP Version: 5.6.22
> Zend API nr: 220131226
> PHP API nr: 20131226
> Debug Build: no
> Thread Safe Build: yes
> Configuration File Path: /etc
> Configuration File: /etc/php.ini
> Extensions directory: /usr/lib64/php-zts/modules
>
>
> Looking forward to your support.

This is typical of Debian + Ubuntu + derivative systems.

Here's how to fix this on Ubuntu.

1) locate xdebug.ini | grep apache2

2) verify there's only a single /etc/php5/apache2/conf.d/*-xdebug.ini file

3) /etc/php5/apache2/conf.d/20-xdebug.ini is best one to keep, as this is
    conf file package manager effects during updates

4) remove others, like /etc/php5/apache2/conf.d/05-xdebug.ini

5) if problem persists, try - php -i | grep xdebug.ini - which will give
    you the cli conf file load order, then change out /cli/ for /apache2/
    in the resulting links

6) if all else fails, you may also find what you're looking for in phpinfo
Received on Fri Jul 01 2016 - 15:52:42 BST

This archive was generated by hypermail 2.2.0 : Mon Jun 25 2018 - 06:00:04 BST