mac下安装mcrypt扩展
来源:互联网 发布:阿里云控制台 html 编辑:程序博客网 时间:2024/06/08 18:25
The mcrypt extension is missing. Please check your PHP configuration.
The above error appears after you successfully get phpMyAdmin up and running on OS X, generally you don’t have to worry about it, you only need to address the error if you are going to use a web application that requires it, for example Magento, the shopping cart software or a php framework like Laravel.
mcrypt is a file encryption method using secure techniques to exchange data. This tutorial has been tested in 10.9 Mavericks.
There are two ways to solve this issue on OSX, it depends on what your comfortable with and what you already have – this guide takes you through staying what you already have by installing and compiling code to get the extension running, an alternative is to use a packaged version of PHP which already has the mcrypt extension compiled and enabled, this for some would be an easier option to deploy – see that PHP guide here.
Xcode
Get Xcode 5.0.2 from the Apple app store, free download version, then install it from the /Applications folder it will be called ‘Install Xcode’ or just Xcode.app. You need this to use the compilers to compile the source code that you will download.
Go to Xcode preferences and then look in the ‘Locations’ button.
Select the Xcode 5.0.2 command line tools from the Locations of Xcode.
Then install the Command Line Tools via the Terminal
It will prompt a dialog box to install them
Getting it on in OS X Mavericks
This tutorial works mostly in the Terminal, launch it from /Applications/Utilities, change directory (cd) to the home account and make a directory that you will work in, call itmcrypt
cd ~ ; mkdir mcrypt ; cd mcrypt
Get libmcrypt 2.5.8 from Sourceforge, this is direct download link.
Get the php code in a tar.gz or .bz2 format- (version 5.4.17 is the one that currently ships with OSX 10.9)
Check your version at the command line:
php -v
Move both of these files that you downloaded into your working directory – mcrypt in this instance and go back to Terminal
cd ~/mcrypt
Expand both files via the command line or just double click them in the Finder:
tar -zxvf libmcrypt-2.5.8.tar.gz
tar -zxvf php-5.4.17.tar.gz
Remove the compressed archives
rm *.gz
Any errors on the command line including C++ and g++ mostly are due to Xcode not being installed or the command line tools missing.
Configuring libmcrypt
cd libmcrypt-2.5.8
./configure
make
sudo make install
With the libmcrypt configured and libraries now installed, time for to make the mcrypt extension.
Autoconf Errors
If the below error occurs after you try the following compile of mcrypt, then autoconf is not installed. (I didn’t get these errors in an upgrade to Mavericks which had autoconf prior but a new installation will need autoconf installed).
Cannot find autoconf. Please check your autoconf installation and the$PHP_AUTOCONF environment variable. Then, rerun this script.
Autoconf is not installed with the latest Xcode but may be present on some OS X from an upgraded older Xcode.
If you need autoconf – some more Terminal heavy lifting:
cd ~/mcrypt
curl -O http://ftp.gnu.org/gnu/autoconf/autoconf-latest.tar.gz
tar xvfz autoconf-latest.tar.gz
cd autoconf-2.69/
./configure
make
sudo make install
Compile mcrypt php Extension
cd ../php-5.4.17/ext/mcrypt/
/usr/bin/phpize
Output should be:
Configuring for:
PHP Api Version: 20100412
Zend Module Api No: 20100525
Zend Extension Api No: 220100525
./configure
make
sudo make install
The result of this should be:
Installing shared extensions: /usr/lib/php/extensions/no-debug-non-zts-20100525/
Enabling mcrypt.so php Extension
Open /etc/php.ini and add the line below at the end
extension=mcrypt.so
If there is no php.ini file, then you need to make one from php.ini.default in the same location like so:
sudo cp /etc/php.ini.default /etc/php.ini
And allow write capability
sudo chmod u+w /etc/php.ini
Then add the line as above in your favourite text editor:
sudo nano /etc/php.ini
or
sudo vi /etc/php.ini
and add in the line:
extension=mcrypt.so
- mac下安装mcrypt扩展
- mac下安装mcrypt扩展
- mac os下php安装mcrypt扩展
- mac安装mcrypt PHP扩展
- mac下php扩展mcrypt无法安装问题
- linux 下安装mcrypt扩展
- linux 下安装mcrypt扩展
- 整理 mac 安装php扩展mcrypt
- Mac 10.9安装php扩展mcrypt
- Mac os 安装mcrypt扩展 【总结】
- CentOS下php安装mcrypt扩展
- CentOS下php安装mcrypt扩展
- CentOS下php安装mcrypt扩展
- CentOS下php安装mcrypt扩展
- CentOS7下php安装mcrypt扩展
- CentOS下php安装mcrypt扩展
- CentOS下php安装mcrypt扩展
- CentOS下php安装mcrypt扩展
- TYVJ P1334 powermax
- 《Java虚拟机原理图解》1.5、 class文件中的方法表集合--method方法在class文件中是怎样组织的
- Phonegap-Android的backbone-min.js之集合
- Jquery插件——thickbox分享
- 网络字节序
- mac下安装mcrypt扩展
- 设计模式C++学习笔记之二(Proxy代理模式)
- Android仿QQ窗口的抖动的动画效果
- usb hid gadget模拟鼠标键盘
- C++中父类的虚函数必须要实现吗?
- led58k280j电视刷机
- android:windowSoftInputMode
- 使用NLPIR汉语分词工具进行中文分词(java语言)
- 关于集群、负载均衡、分布式的区别