Unable to install xdebug - undefined symbol: zend_post_startup_cb

6,564

Solution 1

I was able to install it by executing sudo apt-get install php-xdebug. I wonder why it does not work if I try to install it manually by going the official way and installing it via source...??

However, I get "Waiting for Connection" in NetBeans and nothing happens, but this is another problem...

Solution 2

In my case, since I use php7.2 and there is another PHP version installed on my Ubuntu, so, I have to install the xdebug with the correct version.

I follow the step given from the official site: https://xdebug.org/wizard.
But I have to change some syntax to use the correct PHP version like phpize needs to be changed to phpize-7.2 and use the specific php-config version to do the ./configure step like this:
./configure --with-php-config=/usr/bin/php-config7.2

Reference: http://ubuntuhowtoo.blogspot.com/2020/06/php-xdebug-multi-php-versions-in-server.html

Solution 3

In my case, i just put this xdebug config the wrong file:

[xdebug]
zend_extension="/usr/lib/php/20190902/xdebug.so"
xdebug.remote_enable=1
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000

which is /etc/php/7.2/cli/php.ini , instead, it should be /etc/php/7.2/apache2/php.ini

Solution 4

I found this error by trying to install xdebug for php 7.2 on my Fedora, following the official xdebug instructions. I installed that version via remi repository since I have more than one version of php installed. After hours of trying to fix this error, I found that there is an official release of xdebug compatibile with php from remi repository. It can be installed as easily as running this command and it works perfectly.

sudo yum install php72-php-xdebug
Share:
6,564
Black
Author by

Black

Full-Stack Webdeveloper, Magento & more.

Updated on September 18, 2022

Comments

  • Black
    Black over 1 year

    I uninstalled php7 with apt-get purge php and installed it again with zypper in php7 php7-mysql.

    Then I followed the install instructions of xdebug and restarted apache with systemctl restart apache2, but there is no xdebug in my phpinfo(), only some occurences in HTTP_HEADER e.g. (XDEBUG_SESSION=netbeans-xdebug;)

    This is my configuration in php.ini:

    [xdebug]
    zend_extension = /usr/lib64/php7/extensions/xdebug.so
    xdebug.remote_autostart=on
    xdebug.remote_enable=on
    xdebug.remote_handler="dbgp"
    xdebug.remote_host="192.168.40.161"
    xdebug.remote_port=9000
    xdebug.remote_mode=req
    xdebug.idekey="netbeans-xdebug"
    xdebug.renite_enable = 1
    xdebug.max_nesting_level = 1000
    xdebug.profiler_enable_trigger = 1
    xdebug.profiler_output_dir = '/var/log/xdebug'
    

    The file /usr/lib64/php7/extensions/xdebug.so does exist, I just installed xdebug from source and copied xdebug.so from modules/xdebug.so to /usr/lib64/php7/extensions/

    I even restarted the whole server.

    How can I fix this?

    Update:

    I checked the apache2 error log /var/log/apache2/error_log and noticed that this is getting logged just right after restarting the apache2 service:

    [Tue Jul 30 14:25:08.674685 2019] [mpm_prefork:notice] [pid 4862] AH00170: caught SIGWINCH, shutting down gracefully
    AH00558: httpd-prefork: Could not reliably determine the server's fully qualified domain name, using 192.168.40.44. Set the 'ServerName' directive globally to suppress this message
    [Tue Jul 30 14:25:08.758551 2019] [ssl:warn] [pid 5060] AH01873: Init: Session Cache is not configured [hint: SSLSessionCache]
    Failed loading /usr/lib64/php7/extensions/xdebug.so:  /usr/lib64/php7/extensions/xdebug.so: undefined symbol: zend_post_startup_cb
    [Tue Jul 30 14:25:08.765786 2019] [mpm_prefork:notice] [pid 5060] AH00163: Apache/2.4.33 (Linux/SUSE) OpenSSL/1.1.0i-fips PHP/7.2.5 configured -- resuming normal operations
    [Tue Jul 30 14:25:08.765815 2019] [core:notice] [pid 5060] AH00094: Command line: '/usr/sbin/httpd-prefork -D SYSCONFIG -C PidFile /var/run/httpd.pid -C Include /etc/apache2/sysconfig.d//loadmodule.conf -C Include /etc/apache2/sysconfig.d//global.conf -f /etc/apache2/httpd.conf -c Include /etc/apache2/sysconfig.d//include.conf -D SYSTEMD -D FOREGROUND'
    

    => Failed loading /usr/lib64/php7/extensions/xdebug.so: /usr/lib64/php7/extensions/xdebug.so: undefined symbol: zend_post_startup_cb