Lnmp architecture deploy dynamic web environment .2019-7-3-1.3

Php installation

First, install ready

1, Php dependencies

[root@Lnmp tools]# yum install -y zlib libxml libjpeg freetype libpng gd curl libiconv zlib-devel libxml2-devel libjpeg-devel freetype-devel libpng-devel gd-devel curl-devel

[root@Lnmp tools]# rpm -qa zlib libxml libjpeg freetype libpng gd curl libiconv zlib-devel libxml2-devel libjpeg-devel freetype-devel libpng-devel gd-devel curl-devel  #检查

You need to install a character set conversion library

[root@Lnmp tools]# tar zxf libiconv-1.14.tar.gz 

[root@Lnmp tools]# cd libiconv-1.14 

[root@Lnmp libiconv-1.14]# ./configure --prefix=/usr/local/libiconv

[root@Lnmp libiconv-1.14]# make 

[root@Lnmp libiconv-1.14]# make install

In addition you need to install an encrypted database

[root@Lnmp tools]# wget http://downloads.sourceforge.net/mcrypt/libmcrypt-2.5.8.tar.gz?modtime=1171868460&big_mirror=0

[root@Lnmp tools]# tar zxf libmcrypt-2.5.8.tar.gz

[root@Lnmp tools]# cd libmcrypt-2.5.8

[root@Lnmp libmcrypt-2.5.8]# ./configure

[root@Lnmp libmcrypt-2.5.8]# make

[root@Lnmp libmcrypt-2.5.8]# make install

[root@Lnmp libmcrypt-2.5.8]# sleep 2

[root@Lnmp libmcrypt-2.5.8]# ./configure --enable-ltdl-install

[root@Lnmp libmcrypt-2.5.8]# make

[root@Lnmp libmcrypt-2.5.8]# make install

# Is not installed no problem

Installation mhash

[root@Lnmp tools]# wget "http://downloads.sourceforge.net/mhash/mhash-0.9.9.9.tar.gz?modtime=1175740843&big_mirror=0"

[Root @ Lnmp tools] # tar zxf mhash-0.9.9.9.tar.gz 

[root@Lnmp tools]# cd mhash-0.9.9.9

[root@Lnmp mhash-0.9.9.9]# ./configure

[root@Lnmp mhash-0.9.9.9]# make

[root@Lnmp mhash-0.9.9.9]# make install

[root@Lnmp mhash-0.9.9.9]# sleep 2

[root@Lnmp tools]# ln -s /usr/local/lib64/libmcrypt.la /usr/lib64/libmcrypt.la
[root@Lnmp tools]# ln -s /usr/local/lib64/libmcrypt.so /usr/lib64/libmcrypt.so
[root@Lnmp tools]# ln -s /usr/local/lib64/libmcrypt.so.4 /usr/lib64/libmcrypt.so.4
[root@Lnmp tools]# ln -s /usr/local/lib64/libmcrypt.so.4.4.8 /usr/lib64/libmcrypt.so.4.4.8
[root@Lnmp tools]# ln -s /usr/local/lib64/libmhash.a /usr/lib64/libmash.a
[root@Lnmp tools]# ln -s /usr/local/lib64/libmhash.la /usr/lib64/libmash.la
[root@Lnmp tools]# ln -s /usr/local/lib64/libmhash.so /usr/lib64/libmash.so
[root@Lnmp tools]# ln -s /usr/local/lib64/libmhash.so.2 /usr/lib64/libmash.so.2
[root@Lnmp tools]# ln -s /usr/local/lib64/libmhash.so.2.0.1 /usr/lib64/libmash.so.2.0.1
[root@Lnmp tools]# ln -s /usr/local/lib64/libmcrypt-config /usr/bin/libmcrypt-config

[root@Lnmp tools]# wget "http://downloads.sourceforge.net/mcrypt/mcrypt-2.6.8.tar.gz?modtime=1194463373&big_mirror=0"

[root@Lnmp tools]# tar zxf mcrypt-2.6.8.tar.gz 

[root@Lnmp tools]# cd mcrypt-2.6.8

[root@Lnmp mcrypt-2.6.8]# /sbin/ldconfig 

[root@Lnmp mcrypt-2.6.8]# ./configure LD_LIBRARY_PATH=/usr/local/lib

[root@Lnmp mcrypt-2.6.8]# make 

[root@Lnmp mcrypt-2.6.8]# make install

[root@Lnmp mcrypt-2.6.8]# cd ../

[root@Lnmp tools]# sleep 2

Second, install PHP

[root@Lnmp tools]# tar xf php-5.3.27.tar.gz

[root@Lnmp tools]# cd php-5.3.27

[root@Lnmp php-5.3.27]# yum install libxslt* -y

[root@Lnmp php-5.3.27]#  ./configure \--prefix=/application/php5.3.27 --with-mysql=/application/mysql --with-iconv-dir=/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

Appeared Thank you for using PHP. Description Compile success

[root@Lnmp php-5.3.27]# make

# If the following error is reported because no compiler installed libltdl

/usr/bin/ld: cannot find -lltdl

Solution:

#cd libmcrypt-2.5.8/

#cd libltdl/

#./configure --enable-ltdl-install

#make && make install

[root@Lnmp php-5.3.27]# make install

[root@Lnmp php-5.3.27]# ln -s /application/php5.3.27/ /application/php

[root@Lnmp php-5.3.27]# ll /application/php/

Third, configure PHP

[root@Lnmp php-5.3.27]# cp php.ini-production /application/php/lib/php.ini

[root@Lnmp php-5.3.27]# cd /application/php/etc/

[root@Lnmp etc]# cp php-fpm.conf.default php-fpm.conf

[root@Lnmp etc]# vim php-fpm.conf 

25 pid = /app/logs/php-fpm.pid

32 error_log = /app/logs/php-fpm.log

50 log_level = error

93 rlimit_files = 32768

108  events.mechanism = epoll

162 listen.owner = nginx

163 listen.group = nginx

217 pm.max_children = 1024

222 pm.start_servers = 16

227 pm.min_spare_servers = 5

232 pm.max_spare_servers = 20

237 pm.process_idle_timeout = 15s;

243 pm.max_requests = 2048

423 slowlog = /app/logs/$pool.log.slow

429 request_slowlog_timeout = 10

506 php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f [email protected]

[Root @ Lnmp etc] # mkdir -p / app / logs # Create a log directory

[Root @ Lnmp etc] # / application / php / sbin / php-fpm -t # syntax checking

[Root @ Lnmp etc] # / application / php / sbin / php-fpm # Start Service

PHP installation

All services will start on next /etc/rc.local (post launch)

[root@Lnmp etc]# vim /etc/rc.local

/etc/init.d/mysqld start
/application/php/sbin/php-fpm
/application/nginx/sbin/nginx

 

Guess you like

Origin www.cnblogs.com/DevonL/p/11125160.html