一键安装lnmp之php-创新互联

#!/bin/sh

目前成都创新互联已为近1000家的企业提供了网站建设、域名、网站空间、网站托管、服务器托管、企业网站设计、通河网站维护等服务,公司将坚持客户导向、应用为本的策略,正道将秉承"和谐、参与、激情"的文化,与客户和合作伙伴齐心协力一起成长,共同发展。

#一键安装LNMP中的php

#required soft

#libiconv-1.14.tar.gz

#libmcrypt-2.5.8.tar.gz

#mcrypt-2.6.8.tar.gz

#mhash-0.9.9.9.tar.gz

#php-5.3.27.tar.gz

#php-fpm.conf

#安装相关依赖库

yum install zlib libxml libjpeg freetype libpng gd  curl libiconv  zlib-devel libxml2-devel libjpeg-devel freetype-devel libpng-devel gd-devel curl-devel libxslt* -y

#安装libiconv依赖库,用于字符集转换的库

[ -e /home/lvnian/tools ] || mkdir -p /home/lvnian/tools

cd /home/lvnian/tools

#wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz

tar zxf libiconv-1.14.tar.gz

cd libiconv-1.14

./configure --prefix=/usr/local/libiconv

make

make install

cd ..

[ $? -ne 0 ] && {

echo "libiconv is fail !!"

exit 1

}

#安装加密库(不是必须的)

tar zxf libmcrypt-2.5.8.tar.gz

cd libmcrypt-2.5.8

./configure

make && make install

/sbin/ldconfig

cd libltdl/

./configure --enable-ltdl-install

make && make install

[ $? -ne 0 ] && {

echo "libmcrypt is fail !!"

exit 1

}

###

cd /home/lvnian/tools

tar zxf mhash-0.9.9.9.tar.gz

cd mhash-0.9.9.9

./configure

make && make install

[ $? -ne 0 ] && {

echo "mhash is fail !!"

exit 1

}

#安装mcrypt

cd /home/lvnian/tools

tar zxf mcrypt-2.6.8.tar.gz

cd  mcrypt-2.6.8

sleep 2

/sbin/ldconfig

./configure LD_LIBRARY_PATH=/usr/local/lib

make

make install

[ $? -ne 0 ] && {

echo "mcrypt is fail !!"

exit 1

}

##安装php

cd /home/lvnian/tools

tar zxf php-5.3.27.tar.gz

cd php-5.3.27

./configure \

--prefix=/application/php5.3.27 \

--with-mysql=/application/mysql \

--with-iconv=/usr/local/libiconv \

--with-freetype-dir \

--with-jpeg-dir \

--with-png-dir \

--with-zlib \

--with-libxml-dir=/usr \

--enable-xml \

--disable-rpath \

--enable-safe-mode \

--enable-bcmath \

--enable-shmop \

--enable-sysvsem \

--enable-inline-optimization \

--with-curl \

--with-curlwrappers \

--enable-mbregex \

--enable-fpm \

--enable-mbstring \

--with-mcrypt \

--with-gd \

--enable-gd-native-ttf \

--with-openssl \

--with-mhash \

--enable-pcntl \

--enable-sockets \

--with-xmlrpc \

--enable-zip \

--enable-soap \

--enable-short-tags \

--enable-zend-multibyte \

--enable-static \

--with-xsl \

--with-fpm-user=nginx \

--with-fpm-group=nginx \

--enable-ftp

ln -s /application/mysql/lib/libmysqlclient.so.18 /usr/lib64

cp /home/lvnian/tools/php-5.3.27/ext/phar/phar.php /home/lvnian/tools/php-5.3.27/ext/phar/phar.phar

y

cp /home/lvnian/tools/php-5.3.27/ext/phar/phar/phar.php /home/lvnian/tools/php-5.3.27/ext/phar/phar.php

y

make

cp /home/lvnian/tools/php-5.3.27/ext/phar/phar.php /home/lvnian/tools/php-5.3.27/ext/phar/phar.phar

y

make install

[ $? -ne 0 ] && {

echo "php is fail !!"

exit 1

}

#制作php的软连接

 ln -s /application/php5.3.27/ /application/php

 ll /application

#配置php

cp  /home/lvnian/tools/php-5.3.27/php.ini-production /application/php/lib/php.ini

cp /home/lvnian/tools/php-fpm.conf /application/php/etc/

 mkdir /app/logs/ -p

 /application/php/sbin/php-fpm -t

 #启动php

 /application/php/sbin/php-fpm

 sleep 5

 echo '----------------------php--------------------------'

 netstat -lntup | grep php |grep -v grep

lsof -i :9000

另外有需要云服务器可以了解下创新互联cdcxhl.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。


网站名称:一键安装lnmp之php-创新互联
本文URL:http://ybzwz.com/article/cscipg.html