您好,登錄后才能下訂單哦!
#!/bin/sh
#一鍵安裝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
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。