在php网站下载合适的安装包,如php-5.6.15.tar.bz2
http://www.php.net/downloads.php
解压 tar xvf php-5.6.15.tar.bz2
cd php-5.6.15
配置选项
./configure --prefix=/home/work/srv/php --enable-fpm --with-mcrypt=/usr/lib/libmcrypt \
--enable-mbstring --disable-pdo --with-curl --disable-debug --disable-rpath \
--enable-inline-optimization --with-bz2 --with-zlib --enable-sockets \
--enable-sysvsem --enable-sysvshm --enable-pcntl --enable-mbregex \
--with-mhash --enable-zip --with-pcre-regex --with-mysql --with-mysqli \
--with-gd --with-jpeg-dir
参考文章:
安装php环境
PHP安装mcrypt.so报错 mcrypt.h not found 的解决办法
今天在编译php的时候,出现如下错误php安装出错:configure: error: mcrypt.h not found. Please reinstall libmcrypt.,意思是,没有查找到mcrytp.h,需要安装libcrytp,在下面的地址下载libmarypt:
wget ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/attic/libmcrypt/libmcrypt-2.5.7.tar.gz
安装:
tar -zxvf libmcrypt-2.5.7.tar.gz
cd libmcrypt-2.5.7
./configure
make
make install
然后再安装PHP
http://luhuang.sinaapp.com/php-configure-error-mcrypth-reinstall-libmcrypt/
有时候会缺少这个动态库。
libmcrypt.so.4