php-fpm安装

php-fpm编码安装

安装前准备

yum -y install gcc automake autoconf libtool make

yum -y install gcc gcc-c++ glibc

以上已经安装了可以不用安装
yum -y install libmcrypt-devel mhash-devel libxslt-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel sqlite-devel sqlite
1. wget https://github.com/kkos/oniguruma/archive/v6.9.4.tar.gz -O oniguruma-6.9.4.tar.gz

在这里插入图片描述
如果出现以上这种情况:请参照下面的做法
在这里插入图片描述
写入格式:

140.82.114.4 github.com

如果不是github.com 可以访问网站:ipaddress.com 输入对应得网址查出它的IP,再按照上面的格式写入即可。

2. tar -xvf oniguruma-6.9.4.tar.gz
3. cd oniguruma-6.9.4/
4. ./autogen.sh
5. ./configure --prefix=/usr --libdir=/lib64
6. make && make install

安装php-fpm

cd /home
wget https://mirrors.sohu.com/php/php-7.4.16.tar.gz
tar -zxvf php-7.4.16.tar.gz
cd php-7.4.16

./configure --prefix=/usr/local/php  --enable-fpm --with-mcrypt --enable-mbstring --disable-pdo --with-curl --disable-debug  --disable-rpath --enable-inline-optimization --with-bz2  --with-zlib --enable-sockets --enable-sysvsem --enable-sysvshm --enable-pcntl --enable-mbregex --with-mhash --enable-zip --with-pcre-regex --with-mysql --with-mysqli --with-gd --with-jpeg-dir

make all install

安装完成之后,需要生成php-fpm配置文件

cd /usr/local/php
cp etc/php-fpm.conf.default etc/php-fpm.conf

cd /usr/local/php/etc/php-fpm.d
cp www.conf.default www.conf

配置nginx.conf ,使nginx将php动态请求发送到PHP解释器处理

如果没有安装nginx 请 前往 nginx安装和环境搭建 安装.

location ~ \.php$ {
    root html;
    fastcgi_pass 127.0.0.1:9000;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include fastcgi_params;
}

测试

在/usr/local/nginx/html下创建index.php文件,输入如下内容
<?php
echo phpinfo();
?>

启动php-fpm

/usr/local/php/sbin/php-fpm

浏览器访问
在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值