>  기사  >  백엔드 개발  >  LNMP环境之PHP编译

LNMP环境之PHP编译

WBOY
WBOY원래의
2016-06-23 13:21:11846검색

[root@yaho php-5.3.27]# useradd -s /sbin/nologin phpadmin

[root@yaho php-5.3.27]# yum install -y libtool-ltdl libtool-ltdl-devel #解决找不到lltdl文件问题

[root@yaho php-5.3.27]#  get http://nchc.dl.sourceforge.net/project/mcrypt/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz                   #下载mcrypt加密包       

$ tar zxf libmcrypt             #解压

$ cd libmcrypt                 #切换目录

$ ./configure                  #编译mcrypt加密包

提示需要缺少c++库

$ yum install -y gcc-c++        #包装缺少依赖包

$ make &&make install             #包装 


[root@yaho php-5.3.27]# ./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --enable-fpm --with-fpm-user=phpadmin --with-fpm-group=phpadmin --with-mysql=/usr/local/mysql --with-mysql-sock=/tmp/mysql.sock --with-libxml-dir --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --with-iconv-dir --with-zlib-dir --with-mcrypt --enable-soap --enable-gd-native-ttf --enable-ftp --enable-mbstring --enable-exif --enable-zend-multibyte --disable-ipv6 --with-pear --with-curl=/usr/bin/ --with-openssl ./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --enable-fpm --with-fpm-user=php-fpm --with-fpm-group=php-fpm --with-mysql-dir=/usr/local/mysql --with-mysql-sock=/tmp/mysql.sock --with-libxml-dir --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --with-iconv-dir --with-zlib-dir --with-mcrypt --enable-soap --enable-gd-native-ttf --enable-ftp --enable-mbstring --enable-exif --enable-zend-multibyte --disable-ipv6 --with-pear --with-curl=/usr/bin/ --with-openssl


[root@yaho php-5.3.27]#  make

[root@yaho php-5.3.27]#  make install

[root@yaho php-5.3.27]# done


当编译时提示mysql 配置错误信息,可尝试将--with-mysql=/usr/local/mysql 修改为:--with-mysql-dir=/usr/local/mysql。蓝色必加项

성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.