mac os x 10.11 安装php 扩展

2015-10-18 10:03  3923人阅读  评论 (0)

原因

因为mac 10.11 增加了Rootless功能,也就是就算你是root权限你也不能写这些目录

方案

之前在网上找了许多文章,看了很多,操作了很多,麻烦死了,还不一定成功!

其实很简单

不就是默认的/usr/lib/php/extensions/no-debug-non-zts-20121212目录写不进去吗,去/etc/php.ini中把extension_dir改成其他目录,把原来目录里边的东西复制到新目录里边.然后把你要装的扩展,编译好以后,把*.so文件复制到这个目录,然后在配置文件里边添加extension=xxx.so,然后...就没有然后了.

以下是更新之前的博客原文 不用看了 用不着了

安装xcode命令行工具

xcode-select --install

关闭 SIP/rootless

重启按住Command+r进入恢复模式 打开终端 找到csrutil

find / -name csrutil

执行

cd CSRUTIL_DIR
./csrutil disable
cp YAF_DIR/modules/yaf.so OSX_HD/usr/lib/php/extensions/no-debug-non-zts-20121212

需要重启

参考 http://coolestguidesontheplanet.com/what-is-sip-in-osx-10-11-el-capitan/

安装autoconf

brew install autoconf

安装php扩展

cd ../php-5.5.27/ext/yaf/
/usr/bin/phpize
./configure
make
make install

参考

http://coolestguidesontheplanet.com/install-mcrypt-for-php-on-mac-osx-10-10-yosemite-for-a-development-server/
http://coolestguidesontheplanet.com/what-is-sip-in-osx-10-11-el-capitan/

说了用不看了 你怎么还是看完了 浪费时间了吧






豫ICP备09035262号-1