Introduction to LNMP architecture, php installation

Introduction to LNMP Architecture

For accessing webpages with many static files, nginx is much faster than apache and supports high concurrency.

mysql installation

php installation

useradd php-fpm

First install yum install libcurl-devel -y

  • After decompression, enter the php directory and execute the following command:

./configure --prefix=/usr/local/php-fpm --with-config-file-path=/usr/local/php-fpm/etc --enable-fpm --with-fpm-user=php-fpm --with-fpm-group=php-fpm --with-mysql=/usr/local/mysql --with-dpo-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-mysql-sock=/tmp/mysql.sock --with-libxml-dir --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --with-iconv-dir --with-zlib-dir --with-bz2 --with-openssl --with-mcrypt --enable-soap --enable-gd-native-ttf --enable-mbstring --enable-sockets --enable-exif

  • make && make install
  • cp php.ini-production /usr/local/php-fpm/etc/php.ini
  • vi /usr/local/php-fpm/etc/php-fpm.conf
[global]
pid = /usr/local/php-fpm/var/run/php-fpm.pid
error_log = /usr/local/php-fpm/var/log/php-fpm.log
[www]
listen = /tmp/php-fcgi.sock
listen.mode = 666
user = php-fpm
group = php-fpm
pm = dynamic
pm.max_children = 50
pm.start_servers = 20
pm.min_spare_servers = 5
pm.max_spare_servers = 35
pm.max_requests = 500
rlimit_files = 1024
  • cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm Copy the startup script
  • chmod 755 /etc/init.d/php-fpm
  •  chkconfig --add php-fpm add boot start
     chkconfig php-fpm on
     service php-fpm start start php-fpm

Successfully opened!

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325479083&siteId=291194637