安装Apache 2.4

更新源:
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

安装服务:
yum -y install httpd

CentOS7启动服务: 
systemctl start httpd.service

CentOS7设置开机启动服务: 
systemctl enable httpd.service

安装源

安装 EPEL 软件包:

$ sudo yum install epel-release

安装 remi 源:

$ sudo yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm

安装 yum 扩展包:

$ sudo yum install yum-utils

启用 remi 仓库:

$ sudo yum-config-manager --enable remi-php72 $ sudo yum update

安装 PHP 服务

安装 PHP7,2

$ sudo yum install php72

输入 php72 -v 查看安装结果

安装 php-fpm 和一些其他模块:

$ sudo yum install php72-php-fpm php72-php-gd php72-php-json php72-php-mbstring php72-php-mysqlnd php72-php-xml php72-php-xmlrpc php72-php-opcache

安装扩展:

yum install mod_php72w

安装编译:

yum install php72w-devel

yum install centos-release-scl
sudo yum install devtoolset-7
scl enable devtoolset-7 bash

 

安装pecl:

yum install php-devel php-pear

php-fpm 服务

设置开机自启

$ sudo systemctl enable php72-php-fpm.service

常用 php-fpm 命令

# 开启服务

$ sudo systemctl start php72-php-fpm.service

# 停止服务

$ sudo systemctl stop php72-php-fpm.service

# 查看状态

$ sudo systemctl status php72-php-fpm.service

路径整理


# nginx 配置文件
/etc/nginx/nginx.conf # nginx 默认项目路径
/usr/share/nginx/html
 

CentOS7安装Apache2和PHP7的更多相关文章

  1. CentOS6.5下安装Apache2.4+PHP7

    CentOS6.5下安装Apache2.4+PHP7 http://blog.csdn.net/along602/article/details/42695779 http://www.th7.cn/ ...

  2. macOS Sierra安装Apache2.4+PHP7.0+MySQL5.7.16

    Mac系统上虽然自带PHP和Apache,但是有时不是我们想要的版本呢.今天我们就在macOS Sierra(10.12.1)上安装比较新的版本的PHP版本,也就是PHP7.0+了.本篇博客我们安装的 ...

  3. Centos7 下安装Apache2 + MySQL + PHP7

    Apache 1.安装Apache yum install httpd 2.设置服务器开机自动启动Apache systemctl enable httpd.service 若要验证是否自动启动可在重 ...

  4. Windows10 下安装 Apache2.4+PHP7.1+MySQL5.7

    这个教程主要是分享如何快速组建WAMP开发环境,对于软件的详细配置,自行参考文档或搜索. Visual C++ Redistributable for Visual Studio 2015 下载地址: ...

  5. CentOS7安装Apache2.4+PHP5.6

    linux系统CentOS7 先下载Apache需要依赖的软件 1.APR 下载地址http://apr.apache.org/download.cgi wget下载路径http://mirror.b ...

  6. centos7 安装LNMP(php7)之 nginx php-fpm yum安装以及配置文件修改

    PHP7.1.6整体参考 https://www.zhihu.com/question/50615606/answer/145699091 http://www.bubuko.com/infodeta ...

  7. centos7 安装LNMP(php7)之php7.0 yum安装

    http://www.jianshu.com/p/35f21210668a 安装过程参考上面的网址

  8. centos7 安装LNMP(php7)之mysql安装,更改密码,远程授权

    1.执行命令 yum install mysql mysql-server mysql-devel -y 知道出现complete!则安装mysql完成 当执行 service mysqld rest ...

  9. CentOS7安装Sql Server、apache2和php72及MSSQL驱动

    CentOS7安装apache2和php72及MSSQL驱动 CentOS7版本: [root@localhost ~]# cat /etc/redhat-release CentOS Linux r ...

随机推荐

  1. web模拟终端 --使用shellinabox

    关于shellinabox ShellInABox实现了一个Web服务器,可以将任意命令行工具导出到基于Web的终端仿真器.任何支持JavaScript和CSS的Web浏览器都可以访问此模拟器,并且不 ...

  2. AI的自学题库-竞赛-基础知识

    阿里云(天池): https://tianchi.aliyun.com/course?spm=5176.12281897.0.0.209439a9UwObn3 天池竞赛:https://tianchi ...

  3. z = z*z + c的分型图如何画

    使用python的图形库. 环境:conda+jupyter notebook 代码如下: import numpy as np from PIL import Image from numba im ...

  4. echarts路径图 绘制上海市52路公交车线路

    busLines = [{"coords":[[121.494687,31.253937],[121.494276,31.254031],[121.494226,31.254042 ...

  5. eclipse 小提示

    1.模糊提示插件 Code Recommenders alt+/ 模糊提示插件 Code Recommenders

  6. Copy Files from Windows 10 to wsl

    Method 1 reboot( close wsl window and reopen ) Method 2 – Windows System Drive as a Mount point Wind ...

  7. Nginx下隐藏index.php

    在用NGINX搭建web网站时遇到一个问题,那就是除了网站的首页能够正常打开,其他的子网站都打不开,显示找不到文件.但是如果你在网址后面加上index.php,子网站就又可以打开了.那么我们怎么才能不 ...

  8. deployment:声明式的升级应用

    9.1.使用RC实现滚动升级 #kubectl rolling-update kubia-v1 kubia-v2 --image=luksa/kubia:v2 使用kubia-v2版本应用来替换运行着 ...

  9. HDU5036(bitset加速传递闭包+期望)

    HDU5036 题解 题目链接 思路: 求出破坏or打开所有门所需要的期望炮弹数量,那么根据期望的线性性质,我们可以求出每一个门的期望值最后累加起来就行了. 我们最后的目标就是求对于一个门\(i\), ...

  10. 实验3-1 求一元二次方程的根 (20 分) 《C语言程序设计实验与习题指导(第3版)》

    本题目要求一元二次方程的根,结果保留2位小数. 输入格式: 输入在一行中给出3个浮点系数a.b.c,中间用空格分开. 输出格式: 根据系数情况,输出不同结果: 1)如果方程有两个不相等的实数根,则每行 ...