Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP Warning: Xdebug MUST be loaded as a Zend extension

Tags:

linux

php

cpanel

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?

like image 744
Username Avatar asked Oct 06 '14 17:10

Username


3 Answers

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

like image 165
tfont Avatar answered Nov 19 '22 10:11

tfont


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"
like image 24
Username Avatar answered Nov 19 '22 12:11

Username


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.

like image 6
JonDoe Avatar answered Nov 19 '22 12:11

JonDoe