1
votes

I can't debug PHP script in Visual Studio Code - Linux (Ubuntu 18.04.2 LTS).

Before Update, the Xdebug version I was fettching error such as :

Xdebug requires Zend Engine API version 320170718. The Zend Engine API version 320160303 which is installed, is outdated.

After an update the Xdebug version now fetching following error:

Error: Failed loading /opt/lampp/lib/php/extensions/no-debug-non-zts-20160303/xdebug.so: /opt/lampp/lib/php/extensions/no-debug-non-zts-20160303/xdebug.so: undefined symbol: zend_empty_string.

This is my PHP status:

php -v

PHP 7.2.17-0ubuntu0.18.04.1 (cli) (built: Apr 18 2019 14:12:38) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.2.17-0ubuntu0.18.04.1, Copyright (c) 1999-2018, by Zend Technologies
    with Xdebug v2.7.2, Copyright (c) 2002-2019, by Derick Rethans

Please correct me if anything is missing at my end.

1

1 Answers

2
votes

I would suggest to use the tailored wizard from the Xdebug website:

Xdebug Wizard

It seems that you are mixing the PHP versions: The Zend Engine API version 20160303 corresponds to PHP 7.1. For 7.2 you will need API version 20170718.

I suppose you have several versions of PHP active - most probably 7.1, 7.2 and 7.3. In such case you need to run the proper phpize - phpize7.2 when going through the wizard.