mac安装lnmp环境中php扩展遇到的问题

36 篇文章 0 订阅

在装好lnmp环境之后,执行php -m命令查看php扩展时,碰到如下警告:

1.

Cannot load Xdebug - it was built with configuration API220131226,NTS, whereas running engine is API220131226,NTS,debug

2.

PHP Warning:  PHP Startup: xhprof: Unable to initialize module

Module compiled with build ID=API20131226,NTS

PHP    compiled with build ID=API20131226,NTS,debug

These options need to match

 in Unknown on line 0


3.

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/opt/php56-gearman/gearman.so' - dlopen(/usr/local/opt/php56-gearman/gearman.so, 9): image not found in Unknown on line 0


在参考了链接 http://youlanglang.com/macxia-nmphuan-jing-de-da-jian-mnmp-2/ 之后,发现如下解决办法:

  • 问题1:如果 php -v 后,mcrypt会有这样的问题
1
2
3
4
5
PHP Warning:  PHP Startup: mcrypt: Unable to initialize module
Module compiled with build ID=API20151012,NTS
PHP compiled with build ID=API20151012,NTS,debug
These options need to match
in Unknown on line 0

则用此命令重装一下

1
brew reinstall mcrypt --build-from-source php70-mcrypt --build-from-source
  • 问题2:如果 php -v 后,memcached 有这样的问题:
1
PHP Deprecated: PHP Startup: memcached.sess_lock_wait and memcached.sess_lock_max_wait are deprecated. Please update your configuration to use memcached.sess_lock_wait_min, memcached.sess_lock_wait_max and memcached.sess_lock_retries in Unknown on line 0Deprecated: PHP Startup: memcached.sess_lock_wait and memcached.sess_lock_max_wait are deprecated. Please update your configuration to use memcached.sess_lock_wait_min, memcached.sess_lock_wait_max and memcached.sess_lock_retries in Unknown on line 0PHP Deprecated: PHP Startup: memcached.sess_lock_wait and memcached.sess_lock_max_wait are deprecated. Please update your configuration to use memcached.sess_lock_wait_min, memcached.sess_lock_wait_max and memcached.sess_lock_retries in Unknown on line 0Deprecated: PHP Startup: memcached.sess_lock_wait and memcached.sess_lock_max_wait are deprecated. Please update your configuration to use memcached.sess_lock_wait_min, memcached.sess_lock_wait_max and memcached.sess_lock_retries in Unknown on line 0PHP 7.0.2 (cli) (built: Jan 7 2016 10:40:26) ( NTS )Copyright (c) 1997-2015 The PHP GroupZend Engine v3.0.0, Copyright (c) 1998-2015 Zend Technologies with Xdebug v2.4.0RC3, Copyright (c) 2002-2015, by Derick Rethans

则需要修改一下配置文件/usr/local/etc/php/7.0/conf.d/ext-memcached.ini,将以下两句注释:

1
2
;memcached.sess_lock_wait = 150000
;memcached.sess_lock_max_wait = 0
  • 问题3:如果 php -v 有以下问题:
1
Cannot load Xdebug - it was built with configuration API320151012,NTS, whereas running engine is API320151012,NTS,debug

则用此命令重装一下:

1
brew install php70-xdebug --build-from-source

我直接使用了一条命令,解决了其中遇到的大部分警告:

brew reinstall php56-pdo-dblib --build-from-source php56-pdo-dblib

--build-from-source


只要将 php56-pdo-dblib替换成你要安装的扩展,即可解决问题。特此记录。其中深层次原因还有待解决,也请看到的朋友可以指点迷津。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

从心所愿

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值