微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Centos 安装php php-fpm

首先来到 php官网,然后选择下载,

wget http://cn2.PHP.net/get/PHP-7.1.1.tar.gz/from/this/mirror

这里的wget下载的是当前目录,就是你当前在哪就下载到哪.

下载的是PHP-7.1.1.tar.gz

用tar命令解压

tar -zxvf PHP-7.1.1.tar.gz

解压得到PHP-7.1.1目录,cd PHP-7.1.1进去这个目录

引用块内容
讲一下fpm功能

将所有的响应数据刷新到客户端

官网解释是这样的
FPM (FastCGI Process Manager) is an alternative PHP FastCGI implementation with some additional features (mostly) useful for heavy-loaded sites.

These features include:

advanced process management with graceful stop/start;

ability to start workers with different uid/gid/chroot/environment,listening on different ports and using different PHP.ini (replaces safe_mode);

stdout and stderr logging;

emergency restart in case of accidental opcode cache destruction;

accelerated upload support;

“slowlog” - logging scripts (not just their names,but their PHP backtraces too,using ptrace and similar things to read remote process’ execute_data) that are executed unusually slow;

fastcgi_finish_request() - special function to finish request and flush all data while continuing to do something time-consuming (video converting,stats processing etc.);

dynamic/static child spawning;

basic SAPI status info (similar to Apache mod_status);

PHP.ini-based config file.

用apache不用PHP-fpm,之所要用PHP-fpm就是用Nginx服务器,Nginx把请求用PHP-fpm转给PHP.

配置

用`./configure –prefix=/usr/local/PHP –enable-PHP-fpm

(这里只用–enable-PHP-fpm来编译进去就行)`指定安装目录

引用块内容
不指定prefix,则可执行文件认放在/usr /local/bin,库文件认放在/usr/local/lib,配置文件认放在/usr/local/etc。其它的资源文件放在/usr /local/share。
你要卸载这个程序,要么在原来的make目录下用一次make uninstall(前提是make文件指定过uninstall),要么去上述目录里面把相关的文件一个个手工删掉。
指定prefix,直接删掉一个文件夹就够了。

编译

make

安装

make install

安装完成

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。