溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

一鍵安裝lnmp之php

發(fā)布時間:2020-06-06 17:33:04 來源:網(wǎng)絡(luò) 閱讀:593 作者:lvnian2009 欄目:web開發(fā)

#!/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


#安裝相關(guān)依賴庫

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依賴庫,用于字符集轉(zhuǎn)換的庫

[ -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


向AI問一下細節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI