欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

LNMP环境之PHP编译

程序员文章站 2022-04-28 12:01:39
...
[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。蓝色必加项

相关标签: LNMP环境之PHP编译