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

AndyMacBookPro:~ andy$ php -m
PHP Warning:  Xdebug MUST be loaded as a Zend extension in Unknown on line 0
[PHP Modules]
bcmath
bz2
calendar
Core
ctype
curl
date
dba
dom
ereg
exif
fileinfo
filter
ftp
gd
hash
iconv
json
ldap
libxml
mbstring
mssql
mysql
mysqli
mysqlnd
openssl
pcre
PDO
pdo_dblib
pdo_mysql
PDO_ODBC
pdo_sqlite
Phar
posix
readline
redis
Reflection
session
shmop
SimpleXML
snmp
soap
sockets
SPL
sqlite3
standard
sysvmsg
sysvsem
sysvshm
tidy
tokenizer
wddx
xdebug
xml
xmlreader
xmlrpc
xmlwriter
xsl
zip
zlib


[Zend Modules]


AndyMacBookPro:~ andy$



现在我们来解决这个问题:


我们找到我们的php.ini,我的在:/private/etc/php.ini


其中找到xdebug扩展加载处:

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

修改为:

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


之后我们重启apache:

sudo apachectl restart


然后再查看php扩展:


AndyMacBookPro:~ andy$ php -m
[PHP Modules]
bcmath
bz2
calendar
Core
ctype
curl
date
dba
dom
ereg
exif
fileinfo
filter
ftp
gd
hash
iconv
json
ldap
libxml
mbstring
mssql
mysql
mysqli
mysqlnd
openssl
pcre
PDO
pdo_dblib
pdo_mysql
PDO_ODBC
pdo_sqlite
Phar
posix
readline
redis
Reflection
session
shmop
SimpleXML
snmp
soap
sockets
SPL
sqlite3
standard
sysvmsg
sysvsem
sysvshm
tidy
tokenizer
wddx
xdebug
xml
xmlreader
xmlrpc
xmlwriter
xsl
zip
zlib


[Zend Modules]
Xdebug


AndyMacBookPro:~ andy$


好的,搞定,我们已经看到xdebug已经成功加载到了zend modules中。

你可能感兴趣的:(报错:PHP Warning: Xdebug MUST be loaded as a Zend extension in Unknown on line 0)