PHP Warning: Xdebug MUST be loaded as a Zend extension
Asked Answered
I

5

29

Here's the error I'm getting:

PHP Warning:  Xdebug MUST be loaded as a Zend extension in Unknown on line 0
PHP Warning:  Module 'xdebug' already loaded in Unknown on line 0

This is from my php.ini file:

; Directory in which the loadable extensions (modules) reside.
extension_dir = "/usr/local/lib/php/extensions/no-debug-non-zts-20090626"
zend_extension="/usr/local/IonCube/ioncube_loader_lin_5.3.so"
extension=xdebug.so
zend_extension="xdebug.so"

The file xdebug.so does exist at /usr/local/lib/php/extensions/no-debug-non-zts-20090626

I haven't made any changes and my server has a fresh install of cPanel. Anyone know what would be causing this to happen or see any issues with the information above?

Impropriate answered 6/10, 2014 at 17:38 Comment(4)
Try to comment extension=xdebug.soLavinia
Did none of the search results for Xdebug MUST be loaded as a Zend extension help you?Whitelivered
Just tried that and the error message changed to this Failed loading xdebug.so: xdebug.so: cannot open shared object file: No such file or directoryImpropriate
@Whitelivered I've looked through those suggestions, but most are telling you to just look to make sure it exists and in my case it is looking in the correct directory...Impropriate
I
27

For anyone else who is having this issue, I updated this in my php.ini file and it fixed the error:

; Directory in which the loadable extensions (modules) reside.
extension_dir = "/usr/local/lib/php/extensions/no-debug-non-zts-20090626"
zend_extension = "/usr/local/IonCube/ioncube_loader_lin_5.3.so"
zend_extension = "/usr/local/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so"
extension = "pdo.so"
extension = "pdo_sqlite.so"
extension = "pdo_mysql.so"
extension = "sqlite.so"
Impropriate answered 6/10, 2014 at 18:6 Comment(2)
Only module extensions (those installed with extension=) are found within the extension_dir path. Engine extensions (installed with zend_extension) should use an absolute path.Artel
This answer helped me. My issues was that I included xdebug as 'extension' prior, and again as 'zend_extension'. So just commenting 'extension' load fixed this issueFigurehead
S
33

Just switch extension to zend_extension in your active php.ini file.

Scheller answered 7/1, 2019 at 10:31 Comment(1)
I didn't even know this was a thing. Worked for me on Apache with PHP 7.3.8 on Windows 10. Thank you :)Marinelli
I
27

For anyone else who is having this issue, I updated this in my php.ini file and it fixed the error:

; Directory in which the loadable extensions (modules) reside.
extension_dir = "/usr/local/lib/php/extensions/no-debug-non-zts-20090626"
zend_extension = "/usr/local/IonCube/ioncube_loader_lin_5.3.so"
zend_extension = "/usr/local/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so"
extension = "pdo.so"
extension = "pdo_sqlite.so"
extension = "pdo_mysql.so"
extension = "sqlite.so"
Impropriate answered 6/10, 2014 at 18:6 Comment(2)
Only module extensions (those installed with extension=) are found within the extension_dir path. Engine extensions (installed with zend_extension) should use an absolute path.Artel
This answer helped me. My issues was that I included xdebug as 'extension' prior, and again as 'zend_extension'. So just commenting 'extension' load fixed this issueFigurehead
P
7

The problem is the way IIS adds the extension related configuration to the php.ini file. To solve the problem simple replace in php.ini file,

extension=php_xdebug-2.5.0rc1-7.0-vc14-nts-x86_64.dll

with

zend_extension=php_xdebug-2.5.0rc1-7.0-vc14-nts-x86_64.dll

Although now IIS might not recognize xdebug extension as enabled, it is enabled and can be verified by checking the phpinfo() results.

Phene answered 17/10, 2018 at 7:59 Comment(0)
V
0

First: verify that the output phpize is exactly the same the web /wizar show you.

Verify, after getting phpinfo() that xdebug had been installed correctly. Ctrl + f: xdebug. If not, go for the documentation https://xdebug.org/docs/install#configure-php and how to install using the console on your php verion.

Ventage answered 21/2 at 23:23 Comment(0)
C
-1

For those who have windows, just change the file by the location of the file where the extension is

Comstock answered 8/12, 2022 at 23:27 Comment(1)
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.Macknair

© 2022 - 2024 — McMap. All rights reserved.