您好,登錄后才能下訂單哦!
一、環境
系統:CentOS 6.4x64
IP: 192.168.3.48
二、安裝基礎軟件包
[root@lnmp-test ~]# yum install zlib libxml libjpeg freetype libpng gd curl libiconv zlib-devel libxml2-devel libxslt-devel libjpeg-devel freetype-devel libpng-devel gd-devel curl-devel bzip2 bzip2-devel -y
三、安裝libiconv
#下載軟件 [root@lnmp-test ~]# wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz [root@lnmp-test ~]# tar xf libiconv-1.14.tar.gz [root@lnmp-test ~]# cd libiconv-1.14 [root@lnmp-test libiconv-1.14]# ./configure [root@lnmp-test libiconv-1.14]# make && make install
四、安裝libmcrypt
#下載軟件 [root@lnmp-test ~]# wget http://sourceforge.net/projects/mcrypt/files/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz/download [root@lnmp-test ~]# tar xf libmcrypt-2.5.8.tar.gz [root@lnmp-test ~]# cd libmcrypt-2.5.8 [root@lnmp-test libmcrypt-2.5.8]# ./configure [root@lnmp-test mhash-0.9.9.9]# make && make install [root@lnmp-test mhash-0.9.9.9]# cd libltdl/ [root@lnmp-test libltdl]# ./configure --enable-ltdl-install [root@lnmp-test libltdl]# make && make install #安裝mhash [root@lnmp-test ~]wget http://sourceforge.net/projects/mhash/files/mhash/0.9.9.9/mhash-0.9.9.9.tar.gz/download [root@lnmp-test ~]tar xf mhash-0.9.9.9.tar.gz [root@lnmp-test ~]cd mhash-0.9.9.9 [root@lnmp-test mhash-0.9.9.9] ./configure [root@lnmp-test mhash-0.9.9.9] make && make install #配置軟鏈接信息 [root@lnmp-test mhash-0.9.9.9]# ln -s /usr/local/lib/libmcrypt.la /usr/lib/libmcrypt.la [root@lnmp-test mhash-0.9.9.9]# ln -s /usr/local/lib/libmcrypt.so /usr/lib/libmcrypt.so [root@lnmp-test mhash-0.9.9.9]# ln -s /usr/local/lib/libmcrypt.so.4 /usr/lib/libmcrypt.so.4 [root@lnmp-test mhash-0.9.9.9]# ln -s /usr/local/lib/libmcrypt.so.4.4.8 /usr/lib/libmcrypt.so.4.4.8 [root@lnmp-test mhash-0.9.9.9]# ln -s /usr/local/lib/libmhash.a /usr/lib/libmhash.a [root@lnmp-test mhash-0.9.9.9]# ln -s /usr/local/lib/libmhash.la /usr/lib/libmhash.la [root@lnmp-test mhash-0.9.9.9]# ln -s /usr/local/lib/libmhash.so /usr/lib/libmhash.so [root@lnmp-test mhash-0.9.9.9]# ln -s /usr/local/lib/libmhash.so.2 /usr/lib/libmhash.so.2 [root@lnmp-test mhash-0.9.9.9]# ln -s /usr/local/lib/libmhash.so.2.0.1 /usr/lib/libmhash.so.2.0.1 [root@lnmp-test mhash-0.9.9.9]# ln -s /usr/local/bin/libmcrypt-config /usr/bin/libmcrypt-config
五、安裝mcrypt
#下載軟件 [root@lnmp-test ~]# wget http://sourceforge.net/projects/mcrypt/files/MCrypt/2.6.8/mcrypt-2.6.8.tar.gz/download [root@lnmp-test ~]# tar xf mcrypt-2.6.8.tar.gz [root@lnmp-test ~]# cd mcrypt-2.6.8 [root@lnmp-test mcrypt-2.6.8]# /sbin/ldconfig [root@lnmp-test mcrypt-2.6.8]# ./configure [root@lnmp-test mcrypt-2.6.8]# make && make install [root@lnmp-test mcrypt-2.6.8]# /sbin/ldconfig
六、安裝php
#下載php軟件 [root@lnmp-test ~]# wget http://cn2.php.net/distributions/php-5.5.24.tar.gz [root@lnmp-test php-5.5.24]# ./configure \ > --prefix=/usr/local/php-5.5.24 \ > --with-config-file-path=/usr/local/php-5.5.24/etc \ > --enable-fpm \ > --with-fpm-user=www \ > --with-fpm-group=www \ > --with-mysql=mysqlnd \ > --with-mysqli=mysqlnd \ > --with-pdo-mysql=mysqlnd \ > --with-iconv-dir \ > --with-freetype-dir \ > --with-jpeg-dir \ > --with-png-dir \ > --with-zlib \ > --with-libxml-dir=/usr \ > --enable-xml \ > --disable-rpath \ > --enable-bcmath \ > --enable-shmop \ > --enable-sysvsem \ > --enable-inline-optimization \ > --with-curl \ > --enable-mbregex \ > --enable-mbstring \ > --with-mcrypt \ > --enable-ftp \ > --with-gd \ > --enable-gd-native-ttf \ > --with-openssl \ > --with-mhash \ > --enable-pcntl \ > --enable-sockets \ > --with-xmlrpc \ > --enable-zip \ > --enable-soap \ > --with-gettext \ > --disable-fileinfo \ > --with-kerberos [root@lnmp-test php-5.5.24]# make ZEND_EXTRA_LIBS='-liconv' [root@lnmp-test php-5.5.24]# make install [root@lnmp-test php-5.5.24]# make && make install #配置軟連接信息 [root@lnmp-test php-5.5.24]# ln -s /usr/local/php-5.5.24 /usr/local/php [root@lnmp-test php-5.5.24]# ln -s /usr/local/php/bin/php /usr/bin/php [root@lnmp-test php-5.5.24]# ln -s /usr/local/php/bin/pecl /usr/bin/pec [root@lnmp-test php-5.5.24]# ln -s /usr/local/php/bin/pear /usr/bin/pear [root@lnmp-test php-5.5.24]# ln -s /usr/local/php/bin/phpize /usr/bin/phpize [root@lnmp-test php-5.5.24]# ln -s /usr/local/php/sbin/php-fpm /usr/bin/php-fpm #復制配置文件 [root@lnmp-test php-5.5.24]# cp php.ini-production /usr/local/php/etc/php.ini #[root@lnmp-test php-5.5.24]# cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf [root@lnmp-test php-5.5.24]# cat >/usr/local/php/etc/php-fpm.conf<<EOF > [global] > pid = /usr/local/php/var/run/php-fpm.pid > error_log = /usr/local/php/var/log/php-fpm.log > log_level = notice > > [www] > listen = /tmp/php-cgi.sock > listen.backlog = -1 > listen.allowed_clients = 127.0.0.1 > listen.owner = www > listen.group = www > listen.mode = 0666 > user = www > group = www > pm = dynamic > pm.max_children = 10 > pm.start_servers = 2 > pm.min_spare_servers = 1 > pm.max_spare_servers = 6 > request_terminate_timeout = 100 > request_slowlog_timeout = 0 > slowlog = var/log/slow.log > EOF #[root@lnmp-test php-5.5.24]# sed -i 's@;pid = run/php-fpm.pid@pid = run/php-fpm.pid@' /usr/local/php/etc/php-fpm.conf [root@lnmp-test php-5.5.24]# cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm [root@lnmp-test php-5.5.24]# chmod +x /etc/init.d/php-fpm [root@lnmp-test php-5.5.24]# /etc/init.d/php-fpm start Starting php-fpm done [root@lnmp-test php-5.5.24]# ps aux |grep php root 7992 0.0 0.4 203208 4864 ? Ss 13:50 0:00 php-fpm: master process (/usr/local/php-5.5.24/etc/php-fpm.conf) www 7993 0.0 0.4 203208 4284 ? S 13:50 0:00 php-fpm: pool www www 7994 0.0 0.4 203208 4284 ? S 13:50 0:00 php-fpm: pool www root 7999 0.0 0.0 103248 836 pts/0 S+ 13:50 0:00 grep php
七、安裝zendopcache
# 下載軟件 [root@lnmp-test ~]# wget http://pecl.php.net/get/zendopcache-7.0.3.tgz [root@lnmp-test ~]# tar xf zendopcache-7.0.3.tgz [root@lnmp-test ~]# cd zendopcache-7.0.3 [root@lnmp-test zendopcache-7.0.3]# phpize [root@lnmp-test zendopcache-7.0.3]# ./configure --with-php-config=/usr/local/php/bin/php-config [root@lnmp-test zendopcache-7.0.3]# make && make install #安裝完成后會出現如下信息 Installing shared extensions: /usr/local/php-5.5.24/lib/php/extensions/no-debug-non-zts-20121212/ [root@lnmp-test zendopcache-7.0.3]# cat >> /usr/local/php/etc/php.ini<<EOF > [opcache] > zend_extension=opcache.so > opcache.memory_consumption=128 > opcache.interned_strings_buffer=8 > opcache.max_accelerated_files=4000 > opcache.revalidate_freq=60 > opcache.fast_shutdown=1 > opcache.enable_cli=1 > EOF #重啟php-fpm服務即可 [root@lnmp-test zendopcache-7.0.3]# service php-fpm restart Gracefully shutting down php-fpm . done Starting php-fpm done #將php-fpm添加到開機自動啟動 [root@lnmp-test zendopcache-7.0.3]# chkconfig --add php-fpm [root@lnmp-test zendopcache-7.0.3]# chkconfig php-fpm on
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。