Application of enterprise-class LNMP environment in PHP configuration installation

Source: Internet
Author: User
Tags fpm mcrypt php software

See if Nginx and MySQL have been started! -E Extended Regular expression

[[email protected] ~]# netstat -tunlp | grep -E "nginx|mysql"tcp        0      0 0.0.0.0:3306                0.0.0.0:*                   LISTEN      1476/mysqld         tcp        0      0 0.0.0.0:80                  0.0.0.0:*                   LISTEN      1585/nginx   

LIB libraries and encryption extension libraries required for PHP installation

  [[email protected] ~]# yum install zlib-devel libxml2-devel libjpeg-devel libjpeg-turbo-devel Libiconv-devel-y[[email protected] ~]# yum install freetype-devel libpng-devel gd-devel libcurl-devel Libxslt-devel libxslt-devel-y[[email protected] ~]# cd/home/oldboy/tools[[email protected] tools]# wget Http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz[[email protected] tools]# tar zxf Libiconv-1.14.tar.gz[[email protected] tools]# CD libiconv-1.14[[email protected] libiconv-1.14]#./ Configure--PREFIX=/USR/LOCAL/LIBICONV[[EMAIL PROTECTED]EB01 libiconv-1.14]# make[[email protected] libiconv-1.14]# make install[[email protected] libiconv-1.14]# wget-o/etc/yum.repos.d/epel.repo/http Mirrirs.aliyun.com/repo/epel-6.repo[[email protected] libiconv-1.14]# Yum install-y libmcrypt-devel[[email  protected] libiconv-1.14]# yum install-y mhash[[email protected] libiconv-1.14]# yum install-y mcrypt 

Download the PHP software package and configure the PHP software
Special attention!
(1) the "\" backslash in each configuration represents a newline, and there is no space behind it!
(2) The last line has no backslash!
(3)--prefix=/application/php5.5.32 is the path to the specified PHP installation
(4)--with-mysql=/application/mysql/is the installation path for the specified MySQL. If not installed MySQL can be replaced with--WITH-MYSQL=MYSQLND!
(5)--with-fpm-user and--with-fpm-group are PHP-FPM process management groups and users, as far as possible with nginx users and groups consistent!
(6)--ENABLE-FPM is to start the PFP-FPM service and run the PHP service in Fastcgif way.

cd /home/oldboy/tools/wget http://mirrors.sohu.com/php/php-5.5.32.tar.gztar zxf php-5.5.32.tar.gzcd /home/oldboy/tools/php-5.5.32./configure --prefix=/application/php5.5.32 --with-mysql=/application/mysql/ --with-pdo-mysql=mysqlnd --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-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --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-soap --enable-short-tags --enable-static --with-xsl --with-fpm-user=www --with-fpm-group=www --enable-ftp --enable-opcache=no

Before making, do these two steps first!

[[email protected] tools]# ln -s /application/mysql/lib/libmysqlclient.so.18 /usr/lib64/[[email protected] tools]# cd php-5.5.32[[email protected] php-5.5.32]# touch ext/phar/phar.phar[[email protected] php-5.5.32]# make

The result appears so that the compilation succeeded!

Generating phar.phpGenerating phar.pharPEAR package PHP_Archive not installed: generated phar will require PHP‘s phar extension be enabled.directorytreeiterator.incclicommand.incdirectorygraphiterator.incpharcommand.incinvertedregexiterator.incphar.incBuild complete.Don‘t forget to run ‘make test‘.[[email protected] php-5.5.32]# echo $?0

[[email protected] php-5.5.32]# make install

After the make install completes successfully, the last two lines are as follows:

ln -s -f phar.phar /application/php5.5.32/bin/pharInstalling PDO headers:          /application/php5.5.32/include/php/ext/pdo/
[[email protected] php-5.5.32]# ln-s/application/php5.5.32//application/php[[email protected] php-5.5.32]# Ls/application/phpbin etc include Lib Php sbin var[[email protected] php-5.5.32]# CP Php.ini-prod Uction/application/php/lib/php.ini[[email protected] php-5.5.32]# ls-l/application/php/lib/php.ini- rw-r--r--1 root root 69266 Mar 11:45/application/php/lib/php.ini[[email protected] php-5.5.32]# cd/application /php/etc/[[email protected] etc]# lspear.conf php-fpm.conf.default[[email protected] etc]# CP Php-fpm.conf.default php-fpm.conf[[email protected] etc]#/application/php/sbin/php-fpm [[email       Protected] etc]# lsof-i: 9000COMMAND PID USER FD TYPE DEVICE size/off NODE namephp-fpm 4347 root 7u IPv4 117912 0t0 TCP Localhost:cslistener (LISTEN) php-fpm 4348 www 0u IPv4 117912 0t0 TCP Localhost:cslistener (LISTEN ) php-fpm 4349 www 0u IPv4 117912 0t0 TCP localhost:cslistener (LISTEN) [[EmaiL protected] etc]# Ps-ef |        grep php-fpmroot 4347 1 0 11:50?        00:00:00 Php-fpm:master process (/application/php5.5.32/etc/php-fpm.conf) www 4348 4347 0 11:50?        00:00:00 Php-fpm:pool www www 4349 4347 0 11:50? 00:00:00 Php-fpm:pool www root 4352 1555 0 11:50 pts/1 00:00:00 grep php-fpm

PHP configuration installation for Enterprise-class LNMP environment application practice

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.