22

I am working with the Magento 2.3, and using the PHPStorm as a IDE. Recently I've configured the xdebug in my local for identify some process flow. But it does not helped me to checked the flow.

Then I hit the website in local, I am facing the Uncaught Error: Call to undefined function xdebug_disable() in vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/_bootstrap.php on line 73

I've checked with google bug I couldn't find any proper solution for this. Right now I am using the nginx with PHP7.2

I am looking forward to your support to fix the problem.

Jarnail S
4,70730 gold badges47 silver badges80 bronze badges
asked Dec 15, 2020 at 14:10

5 Answers 5

54

vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/_bootstrap.php

From :-

if (!(bool)$debugMode && extension_loaded('xdebug')) {
 xdebug_disable();
}

To :-

if (!(bool)$debugMode && extension_loaded('xdebug')) {
 if (function_exists('xdebug_disable')) {
 xdebug_disable();
 }
}
Ronak Rathod
6,58020 silver badges46 bronze badges
answered Dec 15, 2020 at 15:05
1
  • 1
    This was a quick workaround that worked for me. Commented Jan 11, 2021 at 9:25
13

You're using Xdebug 3, Magento 2.3 only supports Xdebug 2. You need to downgrade your locally installed Xdebug to the latest version in the 2.x release - pecl install -f xdebug-2.9.8 should work I believe, assuming you have pecl installed.

answered Dec 15, 2020 at 17:40
5
  • Is that right version? Commented Dec 29, 2020 at 2:11
  • 2
    it was still not working after downgrade xdebug Commented Jan 8, 2021 at 12:44
  • I tried the above mentioned command in my system, but it's not install the xdebug, do you any other command to install the particular xdebug version Commented Jan 12, 2021 at 5:31
  • Its also not installing xdebug for me as well, any one had fixed it ? Commented Jan 17, 2021 at 11:22
  • why is it not installing xdebug? what error are you getting? Commented Jan 19, 2021 at 13:49
6

This is a bug in magento2-functional-testing-framework which conflict with xdebug 3, bacause xdebug_disable() was removed in Xdebug 3.

The bug was fixed in the magento2-functional-testing-framework version 3.2.1.


Before the new version is merged in Magento, we could use the quick workaround which from the commit MQE-2391: [GitHub Issue] Magento fails with xdebug 3 due to mftf in version 3.2.1:

In the file dev/tests/functional/standalone_bootstrap.php remove the codes below

if (!(bool)$debug_mode && extension_loaded('xdebug')) {
 xdebug_disable();
}

In the file src/Magento/FunctionalTestingFramework/_bootstrap.php remove the codes below

if (!(bool)$debugMode && extension_loaded('xdebug')) {
 xdebug_disable();
}
answered Jan 25, 2021 at 7:34
5

I faced the same issue after updating and upgrading my Ubuntu server. I needed to downgrade xDebug version to fix this issue for Magento 2.4.1 and PHP7.4:

sudo pecl install -f xdebug-2.9.8

If you get "phpize: command not found" error, you can run pecl command again:

sudo apt-get install php7.4-dev

I use multiple PHP versions on my server. For older version like PHP7.3, you modified its php.ini file and add the path of xdebug-2.9.8. On ubuntu, I edited php.ini by running:

sudo vi /etc/php/7.3/fpm/conf.d/20-xdebug.ini

and added:

zend_extension=/usr/lib/php/20190902/xdebug.so

answered Dec 17, 2020 at 15:21
0

To add on to smstl's answer, which is correct, the problematic files comes from \Magento\FunctionalTestingFramework, which you can remove if not used by running: composer remove --dev magento/magento2-functional-testing-framework

answered Dec 15, 2020 at 20:15

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.