当前位置:Gxlcms > 数据库问题 > LNMP-安装MySQL和PHP

LNMP-安装MySQL和PHP

时间:2021-07-01 10:21:17 帮助过:7人阅读

configure: error: xml2-config not found. Please check your libxml2 installation.

[root@juispan php-5.6.30]# yum install -y libxml2-devel

问题2:configure: error: Cannot find OpenSSL‘s <evp.h>

[root@juispan php-5.6.30]# yum install -y openssl-devel

问题3:configure: error: Please reinstall the BZip2 distribution

[root@juispan php-5.6.30]# yum install -y bzip2-devel

问题4:configure: error: jpeglib.h not found.

[root@juispan php-5.6.30]# yum install -y libjpeg-turbo-devel

问题5:configure: error: png.h not found.

[root@juispan php-5.6.30]# yum install -y libpng-devel

问题6:configure: error: freetype-config not found.

[root@juispan php-5.6.30]# yum install -y freetype-devel

问题7:configure: error: mcrypt.h not found. Please reinstall libmcrypt.

[root@juispan php-5.6.30]# yum install -y libmcrypt-devel

问题8:configure: error: Please reinstall the libcurl distribution -easy.h should be in <curl-dir>/include/curl/

[root@juispan php-5.6.30]# yum install -y libcurl-devel

处理完以上问题后,重新配置出现以下文本:

creating main/internal_functions_cli.c
+--------------------------------------------------------------------+
| License:                                                           |
| This software is subject to the PHP License, available in this     |
| distribution in the file LICENSE.  By continuing this installation |
| process, you are bound by the terms of this license agreement.     |
| If you do not agree with the terms of this license, you must abort |
| the installation process at this point.                            |
+--------------------------------------------------------------------+

Thank you for using PHP.

config.status: creating php5.spec
config.status: creating main/build-defs.h
config.status: creating scripts/phpize
config.status: creating scripts/man1/phpize.1
config.status: creating scripts/php-config
config.status: creating scripts/man1/php-config.1
config.status: creating sapi/cli/php.1
config.status: creating sapi/fpm/php-fpm.conf
config.status: creating sapi/fpm/init.d.php-fpm
config.status: creating sapi/fpm/php-fpm.service
config.status: creating sapi/fpm/php-fpm.8
config.status: creating sapi/fpm/status.html
config.status: creating sapi/cgi/php-cgi.1
config.status: creating ext/phar/phar.1
config.status: creating ext/phar/phar.phar.1
config.status: creating main/php_config.h
config.status: main/php_config.h is unchanged
config.status: executing default commands

以上文本内容表示配置成功,如果不放心可以用“echo $?”确认下。

3、编译与安装

[root@juispan php-5.6.30]# make
[root@juispan php-5.6.30]# make install

4、调整php-fpm配置

[root@juispan php-5.6.30]# cp php.ini-production /usr/local/php-fpm/etc/php.ini
[root@juispan php-5.6.30]# 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
[root@juispan php-5.6.30]# /usr/local/php-fpm/sbin/php-fpm -t
[08-Aug-2017 21:16:46] NOTICE: configuration file /usr/local/php-fpm/etc/php-fpm.conf test is successful

5、启动php-fpm

[root@juispan php-fpm]# cp /usr/local/src/php-5.6.30/sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
[root@juispan php-fpm]# chmod 755 /etc/init.d/php-fpm 
[root@juispan php-fpm]# chkconfig --add php-fpm
[root@juispan php-fpm]#  chkconfig php-fpm on
[root@juispan php-fpm]# service php-fpm start
Starting php-fpm  done
[root@juispan php-fpm]# ps aux|grep php-fpm
root     11303  0.0  0.4 123048  4936 ?        Ss   21:20   0:00 php-fpm: master process (/usr/local/php-fpm/etc/php-fpm.conf)
php-fpm  11304  0.0  0.4 123048  4700 ?        S    21:20   0:00 php-fpm: pool www
php-fpm  11305  0.0  0.4 123048  4700 ?        S    21:20   0:00 php-fpm: pool www
php-fpm  11306  0.0  0.4 123048  4700 ?        S    21:20   0:00 php-fpm: pool www
php-fpm  11307  0.0  0.4 123048  4700 ?        S    21:20   0:00 php-fpm: pool www
php-fpm  11308  0.0  0.4 123048  4704 ?        S    21:20   0:00 php-fpm: pool www
php-fpm  11309  0.0  0.4 123048  4704 ?        S    21:20   0:00 php-fpm: pool www
php-fpm  11310  0.0  0.4 123048  4704 ?        S    21:20   0:00 php-fpm: pool www
php-fpm  11311  0.0  0.4 123048  4704 ?        S    21:20   0:00 php-fpm: pool www
php-fpm  11312  0.0  0.4 123048  4704 ?        S    21:20   0:00 php-fpm: pool www
php-fpm  11313  0.0  0.4 123048  4704 ?        S    21:20   0:00 php-fpm: pool www
php-fpm  11314  0.0  0.4 123048  4704 ?        S    21:20   0:00 php-fpm: pool www
php-fpm  11315  0.0  0.4 123048  4704 ?        S    21:20   0:00 php-fpm: pool www
php-fpm  11316  0.0  0.4 123048  4704 ?        S    21:20   0:00 php-fpm: pool www
php-fpm  11317  0.0  0.4 123048  4704 ?        S    21:20   0:00 php-fpm: pool www
php-fpm  11318  0.0  0.4 123048  4708 ?        S    21:20   0:00 php-fpm: pool www
php-fpm  11319  0.0  0.4 123048  4708 ?        S    21:20   0:00 php-fpm: pool www
php-fpm  11320  0.0  0.4 123048  4708 ?        S    21:20   0:00 php-fpm: pool www
php-fpm  11321  0.0  0.4 123048  4708 ?        S    21:20   0:00 php-fpm: pool www
php-fpm  11322  0.0  0.4 123048  4708 ?        S    21:20   0:00 php-fpm: pool www
php-fpm  11323  0.0  0.4 123048  4708 ?        S    21:20   0:00 php-fpm: pool www
root     11325  0.0  0.0 112664   972 pts/0    R+   21:21   0:00 grep --color=auto php-fpm


本文出自 “Gorilla City” 博客,请务必保留此出处http://juispan.blog.51cto.com/943137/1954974

LNMP-安装MySQL和PHP

标签:lamp

人气教程排行