Antony Marchi
Antony Marchi

Reputation: 56

Undefined symbol: zend_type_to_string

I'm a bit new on ArchLinux but I have installed PHP 7 with pacman and after that Xdebug but Xdebug install the package php ( that is PHP 8 ).

When I tried to launch PHP 7 I got the following message and Xdebug doesn't work:

PHP Warning: Failed loading Zend extension 'xdebug.so' (tried: /usr/lib/php7/modules/xdebug.so (/usr/lib/php7/modules/xdebug.so: undefined symbol: zend_type_to_string), /usr/lib/php7/modules/xdebug.so.so (/usr/lib/php7/modules/xdebug.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0

That's my /etc/php7/conf.d/xdebug.ini

zend_extension=xdebug.so
;xdebug.remote_enable=on
;xdebug.remote_host=127.0.0.1
;xdebug.remote_port=9000
;xdebug.remote_handler=dbgp
;xdebug.start_with_request=yes
;xdebug.mode=debug

So if someone have the solution :)

Upvotes: 1

Views: 1732

Answers (2)

Antony Marchi
Antony Marchi

Reputation: 56

I found the solution here !

$ asp update xdebug
$ asp export xdebug

After that i updated the PKGBUILD

$ cat PKGBUILD 
--------------------------------------------------------------------
# Maintainer: Sergej Pupykin <[email protected]>
# Maintainer: Jonathan Wiersma <arch aur at jonw dot org>
# Contributor: Jonathan Wiersma <arch aur at jonw dot org>
# Contributor: sracker <[email protected]>

pkgname=xdebug-php7
pkgver=3.0.2
pkgrel=2
pkgdesc="PHP debugging extension for php7"
arch=('x86_64')
url="https://www.xdebug.org"
license=('GPL')
depends=('php7')
backup=('etc/php/conf.d/xdebug.ini')
source=("https://xdebug.org/files/xdebug-${pkgver}.tgz"
    'xdebug.ini')
sha256sums=('096d46dec061341868d3e3933b977013a592e2e88992b2c0aba7fa52f87c4e17'
            '7c66883dc2ade69069ef84e30188b25630748aa9c8b0dd123727c00505421205')

build() {
  cd "$srcdir"/xdebug-${pkgver}
  phpize7
  ./configure --prefix=/usr --enable-xdebug
  make
}

package() {
  cd "$srcdir"/xdebug-${pkgver}
  make INSTALL_ROOT="$pkgdir" install
  install -D -m 644 "$srcdir"/xdebug.ini "$pkgdir"/etc/php7/conf.d/xdebug.ini
}
--------------------------------------------------------------

And then i did that makepkg -s -i -r

Upvotes: 2

user1984212
user1984212

Reputation: 23

I had the same problem.

So, I uninstalled PHP 8 and installed Xdebug for PHP 7.4:

yay -S xdebug7

Upvotes: 2

Related Questions