Linux中nginx安装php

1.确保Linux中已经安装nginx模块

可以通过find / -name nginx查看

2.Php安装:

使用yum命令 yum insatll -y epel-release

安装Remi源  yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm

安装yum源管理

yum install -y yum-utils

安装php7-4版本

yum install -y php74-php-fpm php74-php-cli php74-php-bcmath php74-php-gd php74-php-json php74-php-mbstring php74-php-mcrypt php74-php-mysqlnd php74-php-opcache php74-php-pdo php74-php-pecl-crypto php74-php-pecl-mcrypt php74-php-pecl-geoip php74-php-recode php74-php-snmp php74-php-soap php74-php-xmll
 

到这里php已经安装完成

来到nginx目录下的conf目录中的nginx.conf配置文件,将

#location /.php这一段注释去掉

在nginx的html目录下创建index.php文件

输入<?php

phpinfo();

?>

打开浏览器输入ip/index.php即可查看php信息

记得重新启动nginx和php-fpm

启动nginx找到/usr/local/nginx/sbin

执行./nginz

启动php find / -name php-fpm

进入路径下的sbin目录 

执行./php-fpm

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Silnet Master

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值