Install php5.5.34 built by lnmp 1. Download php of php5.5.34
Extract
2. create a php-fpm user
Useradd-s/sbin/nologin php-fpm
3. cd php5.5.34
Run:
4. Compile: [use the configuration options of Amin linux for reference]
./configure \--prefix=/usr/local/php \--with-config-file-path=/usr/local/php/etc \--enable-fpm \--with-fpm-user=php-fpm \--with-fpm-group=php-fpm \--with-mysql=/usr/local/mysql \--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-mcrypt \--enable-soap \--enable-gd-native-ttf \--enable-ftp \--enable-mbstring \--enable-exif \--enable-zend-multibyte \--disable-ipv6 \--with-pear \--with-curl \--with-openssl
2. after compilation/installation
1) copy the configuration file
Cp php. ini-production/usr/local/php/etc/php. ini
2) copy the script:
Cp sapi/fpm/init. d. php-fpm/etc/init. d/php-fpm you can edit only a started shell script.
3) modify permissions for php-fpm
Grant the following permissions:
Chmod 755/etc/init. d/php-fpm
Chkconfig -- add php-fpm
Chkconfig php-fpm on
4) start, service php-fpm start
Note profile: php-fpm.conf
5) You can also check the correctness of the configuration file before starting:
/Usr/local/php/sbin/php-fpm-t
6) start
The installation of mysql is similar.
Errors and solutions:
1. configure: error: no acceptable C compiler found in $ PATH
See 'config. log' for more details
Yum install-y gcc
2.
Configure: error: xml2-config not found. Please check your libxml2 installation.
yum install -y libxml2.x86_64 libxml2-devel.x86_64
3.configure: error: Cannot find OpenSSL's
Yum install-y openssl. x86_64 openssl-devel.x86_64
4.
Error: Please reinstall the libcurl distribution-
Easy. h shoshould be in
/Include/curl/
Yum install-y curl. x86_64 libcurl-devel.x86_64
5. checking whether to enable JIS-mapped Japanese font support in GD... no
If configure fails try -- with-vpx-dir =
Yum install libjpeg. x86_64 libpng. x86_64 freetype. x86_64 libjpeg-devel.x86_64 libpng-devel.x86_64 freetype-devel.x86_64-y
Test results:
6.
Configure: error: Invalid Lib. h not found.
This rubbing error is not used to install libjpeg and libjpeg-devel.
It should be:
Yum install-y libjpeg-turbo.x86_64 libjpeg-turbo-devel.x86_64
7.
Mcrypt. h not found. Please reinstall libmcrypt.
If the yum source does not have this installation package, you need to expand the yum source:
Yum install-y epel-release.noarch
Then find the file
Yum install-y libmcrypt. x86_64 libmcrypt-devel.x86_64
8.
Error: Cannot find MySQL header files under/usr/local/mysql.
Note that the MySQL client library is not bundled anymore!
9. error during startup:
[Root @ ip5 php-5.5.34] # service php-fpm start
Starting php-fpm [27-Apr-2016 17:24:21] ERROR: failed to open configuration file '/usr/local/php/etc/php-fpm.conf': No such file or directory (2)
[27-Apr-2016 17:24:21] ERROR: failed to load configuration file '/usr/local/php/etc/php-fpm.conf'
[27-Apr-2016 17:24:21] ERROR: FPM initialization failed
Failed
Note that there is no configuration file to start php-fpm, then we just need to go to its installation path rename: php-fpm.conf.defult rename: php-fpm.conf
10. when the-fpm of php is started, the following error occurs:
When starting php-fpm, why is this prompt unknown?
[Root @ daiqing php-5.5.31] # service php-fpm start
Starting php-fpm [14-Jan-2016 06:16:59] ERROR: [pool www] cannot get uid for user 'php-fpm'
[14-Jan-2016 06:16:59] ERROR: FPM initialization failed
Failed
Cause Analysis I:
User creation failed. useradd-s/sbin/nologin php-fpm
11. during compilation I, the following parameters are displayed:
-- Enable-zend-multibyte:
The compilation parameter does not exist.
12. View php compilation parameters:
/Usr/local/php/bin/php-I | head