欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

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

程序员文章站 2022-04-21 20:56:20
...
andy@AndyMacBookPro:~$ php -v
PHP Warning: Xdebug MUST be loaded as a Zend extension in Unknown on line 0
PHP 5.4.30 (cli) (built: Jul 29 2014 23:43:29)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies

编辑php.ini

sudo vim /private/php.ini

将:

extension=/usr/local/Cellar/php54-xdebug/2.2.5/xdebug.so

修改为:

zend_extension=/usr/local/Cellar/php54-xdebug/2.2.5/xdebug.so

然后我们再看下,就好了:

andy@AndyMacBookPro:/private/etc$ php -v
PHP 5.4.30 (cli) (built: Jul 29 2014 23:43:29)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
with Xdebug v2.2.5, Copyright (c) 2002-2014, by Derick Rethans
andy@AndyMacBookPro:/private/etc$

关于更多:http://blog.163.com/lgh_2002/blog/static/440175262010910103342213/

zend_extension加载php扩展时需用全路径,而extension加载时可以用相对extension_dir的路径。