在Mac OS X中安装PHP扩展支持的方法
时间:2023-07-18 05:14:26
最近有些MAC OS X用户想在自己的电脑上安装和使用这些PHP扩展,那么该怎么进行安装呢?今天小编将要为大家带来的是在Mac OS X中安装PHP扩展支持的方法!希望对大家会有帮助!有需要的朋友一起去看看吧
Linux系统中有着许多PHP扩展,不过都需要用户们手动安装后才可以使用,一些MAC OS X用户想在自己的电脑上安装和使用这些PHP扩展,那么该怎么进行安装呢?下面就和小编一起来看看具体的安装步骤吧。一起去看看吧!
安装方法:
安装PHP扩展要求你的Mac系统已经安装了Xcode环境和命令行开发工具,如果还没安装,请先使用Shell安装。
xcode-select --install
为了扩展管理方便,首先来安装pecl扩展管理器。
cd /usr/lib/php
sudo php install-pear-nozlib.phar
安装Redis、Memcache、Mongo等扩展。
sudo pecl install redis
sudo pecl install memcache
sudo pecl install mongo
sudo pecl install xdebug
将扩展配置添加的php.ini文件中:
extension=memcache.so
extension=mongo.so
extension=redis.so
zend_extension=xdebug.so
安装xcache,从官网下载http://xcache.lighttpd.net/wiki/Release-3.2.0
解压缩并安装
tar xvf xcache-3.2.0.tar
cd xcache-3.2.0
phpize
。/configure
make
sudo make install
配置XCache
[xcache]
xcache.size = 128M
xcache.var_size = 8M
xcache.var_count = 1
xcache.var_slots = 8K
xcache.var_ttl = 0
xcache.var_maxttl = 0
xcache.var_gc_interval = 300
xcache.optimizer = Off
由于Mac自带的PHP环境是不包括mcrypt扩展的,所以需要下载同版本的php源码包,单独编译这个模块加载。从官网的归档里面找到php5.5.14的源码包,下载:http://php.net/releases/
tar zxvf php-5.5.14.tar.gz
cd php-5.5.14/ext/mcrypt/
phpize
。/configure
make
sudo make install
配置ext-mcrypt
extension=mcrypt.so
为了加速,还需要打开opcache。
zend_extension=opcache.so
[opcache]
; Determines if Zend OPCache is enabled
opcache.enable=0
; Determines if Zend OPCache is enabled for the CLI version of PHP
opcache.enable_cli=0
以上内容就是小编为大家带来的关于在MAC OS X系统中安装PHP扩展的方法了,有需要或者是对此感兴趣的用户,不妨在自己的电脑上尝试操作一下吧。希望可以帮助到大家!
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
Win10蓝牙鼠标连接不上电脑怎么办?
![](https://img.aspxhome.com/file/2023/25/a218702_0s.jpg)
在wps演示中怎样制作倒计时动画
Win10右键菜单怎么加入“移动到/复制到”功能
![](https://img.aspxhome.com/file/2023/4/a309084_0s.jpg)
PDF Expert for Mac怎样将文件夹合并?PDF Expert mac使用教程
![](https://img.aspxhome.com/file/2023/9/a214029_0s.png)
微信拍照如何即时编辑
![](https://img.aspxhome.com/file/2023/9/a343686_0s.jpg)
电脑系统无法搜索蓝牙提示检测不到蓝牙设备的解决方法
![](https://img.aspxhome.com/file/2023/2/a284481_0s.jpg)
WPS文档怎么删除空白页图文教程
Excel中巧用序列填充的步骤
腾讯会议怎么分组讨论
![](https://img.aspxhome.com/file/2023/9/a341075_0s.png)
如何提升蚂蚁庄园荣耀值 蚂蚁庄园荣耀值提升教程
![](https://img.aspxhome.com/file/2023/6/a325240_0s.png)
Excel 如何利用公式 取得两个日期间单元格个数
![](https://img.aspxhome.com/file/2023/2/a161812_0s.png)
无法启用SnippetsLab的iCloud同步功能?
![](https://img.aspxhome.com/file/2023/7/a213397_0s.png)
电脑安装Mathtype导致office 2013弹窗报错的解决方法
![](https://img.aspxhome.com/file/2023/8/16798_0s.jpg)
如何在mac Lightroom CC中使用裁剪工具裁剪照片?使用裁剪工具在Lightroom CC中裁剪照片的图文教程
![](https://img.aspxhome.com/file/2023/3/a214203_0s.jpeg)
Win11系统的日期格式怎么修改?Win11日期格式修改教程
![](https://img.aspxhome.com/file/2023/1/a273252_0s.png)
ppt修改图片大小的三技巧
ppt2013自定义功能区怎么添加项目卡和命令?
![](https://img.aspxhome.com/file/2023/10/a346942_0s.jpg)
Win10更新失败提示0x80070643怎么解决?
![](https://img.aspxhome.com/file/2023/1/48681_0s.jpg)
Win10系统最全的命令提示符快捷键汇总
![](https://img.aspxhome.com/file/2023/28/a243791_0s.jpg)
如何重置BusyCal for Mac?BusyCal for Mac使用教程
![](https://img.aspxhome.com/file/2023/7/a212897_0s.png)