Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

GodziLaravel's avatar

Homestead , when I php -v it returns: Cannot load Xdebug - it was already loaded

Hello ,

when I run php -v

I have this error message :

vagrant@homestead:~$ php -v
Cannot load Xdebug - it was already loaded
Xdebug: [Config] The setting 'xdebug.remote_autostart' has been renamed, see the upgrading guide at https://xdebug.org/docs/upgrade_guide#changed-xdebug.remote_autostart (See: https://xdebug.org/docs/errors#CFG-C-CHANGED)
Xdebug: [Config] The setting 'xdebug.remote_enable' has been renamed, see the upgrading guide at https://xdebug.org/docs/upgrade_guide#changed-xdebug.remote_enable (See: https://xdebug.org/docs/errors#CFG-C-CHANGED)
Xdebug: [Config] The setting 'xdebug.remote_host' has been renamed, see the upgrading guide at https://xdebug.org/docs/upgrade_guide#changed-xdebug.remote_host (See: https://xdebug.org/docs/errors#CFG-C-CHANGED)
PHP 7.4.10 (cli) (built: Sep  9 2020 06:36:14) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Xdebug v3.0.0, Copyright (c) 2002-2020, by Derick Rethans
    with Zend OPcache v7.4.10, Copyright (c), by Zend Technologies
vagrant@homestead:~$

grep -Hnir zend_extension /etc/php/7.4/

vagrant@homestead:~$ grep -Hnir zend_extension /etc/php/7.4/
/etc/php/7.4/mods-available/opcache.ini:3:zend_extension=opcache.so
/etc/php/7.4/cli/php.ini:1916:zend_extension = /usr/lib/php/20190902/xdebug.so
/etc/php/7.4/fpm/conf.d/20-xdebug.ini.save:3:zend_extension = /usr/lib/php/20190902/xdebug.so
/etc/php/7.4/fpm/conf.d/20-xdebug.ini.save:10:zend_extension = /usr/lib/php/20190902/xdebug.so

How can I fix this ?

0 likes
3 replies
Tray2's avatar

In your php.ini file you most likely try to load the xdebug.so twice. Remove one of the rows and you should be good.

2 likes
GodziLaravel's avatar

Thanks @tray2

Now when I php -v I see :

Xdebug: [Config] The setting 'xdebug.remote_enable' has been renamed, see the upgrading guide at https://xdebug.org/docs/upgrade_guide#changed-xdebug.remote_enable (See: https://xdebug.org/docs/errors#CFG-C-CHANGED)
Xdebug: [Config] The setting 'xdebug.remote_host' has been renamed, see the upgrading guide at https://xdebug.org/docs/upgrade_guide#changed-xdebug.remote_host (See: https://xdebug.org/docs/errors#CFG-C-CHANGED)
Xdebug: [Config] The setting 'xdebug.remote_mode' has been renamed, see the upgrading guide at https://xdebug.org/docs/upgrade_guide#changed-xdebug.remote_mode (See: https://xdebug.org/docs/errors#CFG-C-CHANGED)
Xdebug: [Config] The setting 'xdebug.remote_port' has been renamed, see the upgrading guide at https://xdebug.org/docs/upgrade_guide#changed-xdebug.remote_port (See: https://xdebug.org/docs/errors#CFG-C-CHANGED)

Tray2's avatar

Sounds to me that you are using the wrong version of xdebug for your version of php.

Please or to participate in this conversation.