- 工信部备案号 滇ICP备05000110号-1
- 滇公安备案 滇53010302000111
- 增值电信业务经营许可证 B1.B2-20181647、滇B1.B2-20190004
- 云南互联网协会理事单位
- 安全联盟认证网站身份V标记
- 域名注册服务机构许可:滇D3-20230001
- 代理域名注册服务机构:新网数码
1. 说明:在linux下安装lnmp的默认php版本只能使用一个版本,如果有些网站需要低版本5.2或者高版本,那么如何做呢,
2. Lnmp安装时候默认选择了php5.3,但是其中某个网站需要php5.5
3. 编译安装php5.5
(a)安装必要软件
rpm -ivh http://www.landui.com/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
yum groupinstall 'Development Tools'
yum install libmhash-devel
yum install libmhash
yum install libicu-devel
yum -y install krb5*
yum install -y gcc gcc-c++ make gmp-devel libc-client-devel zlib zlib-devel pcre pcre-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers
(b)安装libiconv
wget http://www.landui.com/pub/gnu/libiconv/libiconv-1.14.tar.gz
./configure --prefix=/usr/local/libiconv
make && make install
(c)安装libmcrypt
wget ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/libmcrypt/libmcrypt-2.5.7.tar.gz
(ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/libmcrypt )
tar zxvf libmcrypt-2.5.7.tar.gz
cd libmcrypt-2.5.7
./configure
make && make install
(d)如果是64为操作系统执行以下操作
ln -s /usr/lib64/libc-client.so /usr/lib/libc-client.so
cp -frp /usr/lib64/libldap* /usr/lib/
ln -s /usr/lib64/libpng.so /usr/lib/libpng.so
ln -s /usr/lib64/libjpeg.so /usr/lib/libjpeg.so
ln -s /usr/lib64 /usr/kerberos/lib
cp -r /usr/lib64/mysql/* /usr/lib/mysql/
(e)下载php5.5编译安装
wget http://www.landui.com/distributions/php-5.5.38.tar.gz
tar –zxvf php-5.5.38.tar.gz
cd php-5.5.38
先生成Makefile:
./configure --prefix=/usr/local/php5.5 --with-config-file-path=/usr/local/php5.5/etc --with-config-file-scan-dir=/usr/local/php5.5/php.d --with-mysql --with-mysqli --with-iconv-dir=/usr/local/libiconv --with-mhash=/usr --with-icu-dir=/usr --with-bz2 --with-curl --with-freetype-dir --with-gd --with-gettext --with-gmp --with-imap --with-imap-ssl --with-jpeg-dir --with-kerberos --with-ldap --with-mcrypt --with-openssl --without-pear --with-pdo-mysql --with-png-dir --with-xmlrpc --with-zlib --enable-bcmath --enable-calendar --enable-ctype --enable-dom --enable-exif --enable-ftp --enable-gd-native-ttf --enable-intl --enable-json --enable-mbstring --enable-pcntl --enable-session --enable-shmop --enable-simplexml --enable-soap --enable-sockets --enable-tokenizer --enable-wddx --enable-xml --enable-zip --disable-fileinfo --enable-fpm
开始编译和安装
make && make install
cp php.ini-production /usr/local/php5.5/etc/php.ini
(f)添加php5.5到服务项并设置自动启动:
cp ./sapi/fpm/init.d.php-fpm /etc/init.d/php5.5
chmod +x /etc/init.d/php5.5
cd /usr/local/php5.5/etc/
cp php-fpm.conf.default php-fpm.conf
vi php-fpm.conf 修改监听端口listen 127.0.0.1:9000为listen 127.0.0.1:9001
chkconfig php5.5 on
service php5.5 start
(g)建立新文件/usr/local/nginx/conf/enable-php5.5.conf,内容如下:
(h)最后修改需要php5.5版本的网站配置文件如,www.landui.com
修改include enable-php.conf;为include enable-php5.5.conf;
(i)重启nginx
售前咨询
售后咨询
备案咨询
二维码
TOP