Installation and configuration of Nginx and PHP installation and configuration two PHP-FPM

Source: Internet
Author: User
Tags configuration php fpm mcrypt php download
This article to share the content is about Nginx and PHP installation and configuration two installation and configuration php-fpm, has a certain reference value, the need for friends can refer to

first, compile and install PHP

1. Create the directory where the installation package is located and download unzip:

php Download Address: http://www.php.net/downloads.php


2, specify the installation directory and runtime of the owner and the group, and enable the status monitoring module, etc., under/soft/php/php-5.6.27 :

./configure--prefix=/usr/local/php--with-config-file-path=/etc--enable-inline-optimization--disable-debug-- Disable-rpath--enable-shared--enable-opcache--enable-fpm--with-fpm-user=www--with-fpm-group=www--with-mysql= Mysqlnd--with-mysqli=mysqlnd--with-pdo-mysql=mysqlnd--with-gettext--enable-mbstring--with-iconv--with-mcrypt-- With-mhash--with-openssl--enable-bcmath--enable-soap--with-libxml-dir--enable-pcntl--enable-shmop-- Enable-sysvmsg--enable-sysvsem--enable-sysvshm--enable-sockets--with-curl--with-zlib--enable-zip--with-bz2-- With-readline--without-sqlite3--without-pdo-sqlite--with-pear

--------errors that may occur:

error occurred : Congigure error:xml2-config not found.

Solutions :

Execute Command : sudo yum installlibxml2-devel

See if it's successful : Find/-name "Xml2-config"

-------- An error occurred : Congigure error:cannotfind OpenSSL ' s <evp.h>

Solutions :

Yum Install Opensslopenssl-devel

ln-s/usr/lib64/libssl.so/usr/lib/

-------- An error occurred : configure:error:Please Reinstall the BZIP2 distribution

Solutions : Yum install bzip2 bzip2-devel

-------- An error occurred : configure:error:Please Reinstall the Libcurl distribution-easy.h should be in<curl-dir>/include/curl/

Solutions : yum-y Install Curl-devel

-------- Error occurred : configure:error:mcrypt.h not found. Please reinstall Libmcrypt.

Solutions :sudo yum installlibmcrypt libmcrypt-devel mcrypt Mhash

-------- Error occurred : configure:error:Please Reinstall Readline-i cannot find readline.h
Solutions :sudo yum install Readline-devel


3. Installation:

Make


Make install



4. Start

Add PHP command to environment variable

Vim/etc/profile

Join at the end

Path= $PATH:/usr/local/php/bin

Export PATH

To make the change take effect immediately execution

./etc/profile or Source/etc/profile


5. Configuration PHP-FPM


Cd/usr/local/php/etc

CP php-fpm.conf.defaultphp-fpm.conf

6. Start PHP-FPM

Sudo/usr/local/php/sbin/php-fpm-c/etc/php.ini-y/usr/local/php/etc/php-fpm.conf

(Manual introduction required php.ini file )

Note : If you start PHP-FPM error occurred : Cannot get uid for www , modify php-fpm.conf in User to be Nginx Group to be Nginx

Error:unable to bind listening sockets for address ' 127.0.0.1:9000 '
Workaround:
Kill All PHP-FPM
Then reboot.

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.