首页  >  文章  >  后端开发  >  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