yum方式安裝php nginx

2021-09-01 12:29:07 字數 1438 閱讀 3112

yum install nginx

# 配置:/etc/nginx/nginx.conf

# 常用命令

#啟動systemctl start nginx

#停止systemctl stop nginx

#重啟systemctl restart nginx

#平滑重啟

systemctl reload nginx

1、新增php的yum軟體倉庫

centos/rhel 7.x:

rpm -uvh

rpm -uvh

如果是centos6,那麼執行以下**:

centos/rhel 6.x:

rpm -uvh

rpm -uvh

2、開始安裝php

1. 查詢yun軟體中php7.1的版本

yum list | grep php71w

2. 安裝php

yum install php71w php71w-fpm php71w-cli php71w-common php71w-devel php71w-gd php71w-pdo php71w-mysql php71w-mbstring php71w-bcmath

# 基礎配置 /etc/php.ini

#擴充套件:/etc/php.d/

# php-fpm : /etc/php-fpm.conf /etc/php-fpm.d/www.conf

3. 安裝php幾個重要的擴充套件

1) redis擴充套件

yum install php71w-pecl-redis

2) redis序列化擴充套件

yum install php71w-pecl-igbinary

3) memcached 擴充套件

yum install php71w-pecl-memcached

# yum 方法安裝的擴充套件自動加入到配置檔案中,故不需要另外加配置

#擴充套件的配置目錄 /etc/php.d/*

4. php 服務常用命令

#啟動systemctl start php-fpm

#停止systemctl stop php-fpm

#重啟systemctl restart php-fpm

#平滑重啟

systemctl reload php-fpm

將原文的命令替換成以下

# 開啟msyql 

systemctl start mysql

# 停止

systemctl stop mysql

# 重啟

systemctl restart mysql

# 平滑重啟

systemctl reload mysql

php Nginx 安裝手冊

1 需要安裝的程式 1 http伺服器 nginx 2 php開發環境 phpstorm 3 php安裝環境 php 4 資料庫 postgresql 2 修改nginx conf nginx.conf 找到該段 location php root html fastcgi pass 127.0.0...

ubuntu簡易安裝php nginx

一 安裝php 1,通用安裝php,執行以下命令sudo apt get install php安裝php fpm 記住你安裝php fpm的版本sudo apt get install php fpm2,附帶php5.6安裝 root使用者登入,先執行以下命令 apt get update apt...

PHP nginx環境安裝部署

1.當前使用的原始碼為 2.configure configure prefix usr local php with curl with gd with gettext with kerberos with libdir lib64 with mysqli with openssl with pc...