首先安装APACHE环境,直接用yum安装

yum install httpd httpd-devel
/etc/httpd/
systemctl start httpd.service #启动apache
systemctl stop httpd.service #停止apache
systemctl restart httpd.service #重启apache

然后安装mysql(mariadb)

yum install mariadb mariadb-server
cp /usr/share/mysql/my-huge.cnf /etc/my.cnf
vi /etc/my.cnf
#最后添加
log-slow-queries=/var/log/mariadb/slow.log
long_query_time=1
log-queries-not-using-indexes systemctl start mariadb.service
mysql_secure_installation #(改密码,如果有密码 可能是root1234)

完装完这两个环境之后,现在源码安装PHP7.2.8

#下载镜像文件
wget http://hk1.php.net/get/php-7.2.8.tar.gz/from/this/mirror
tar zxvf mirror
cd php-7.2.8 #如果是新环境,需要安装一些依赖
yum install autoconf gcc httpd-devel libxml2 libxml2-* openssl.x86_64 openssl-devel.x86_64 libcurl.x86_64 libcurl-devel.x86_64 libjpeg.x86_64 libpng.x86_64 freetype.x86_64 libjpeg-devel.x86_64 libpng-devel.x86_64 freetype-devel.x86_64 libjpeg-turbo-devel -y ./configure --with-mysqli --with-curl --with-apxs2=/usr/bin/apxs --with-openssl --enable-mbstring --with-gd --enable-gd-native-ttf --enable-gd-jis-conv --with-jpeg-dir --with-config-file-path=/etc/php.ini make && make install

之后要配置APACHE的配置文件

vi /etc/httpd/conf/httpd.conf
#找到LoadModule 大约在54行左右,在注释下面,加入下面的配置
#php.ini的目录
PHPIniDir /etc
LoadModule php7_module /usr/lib64/httpd/modules/libphp7.so #解析.php文件
<FilesMatch "\.php$">
SetHandler application/x-httpd-php
</FilesMatch> <IfModule dir_module>
DirectoryIndex index.php index.html
</IfModule> AddType application/x-httpd-php .php

之后重启apache就可以使用了

systemctl restart httpd.service

源码安装CentOs7下的PHP7的更多相关文章

  1. centos7 源码安装指定版本的php7

    很多时候可能会遇到需要手动源码安装软件的时候,所以自己实践了一把,并且把安装过程中遇到的问题,以及在网上找到的解决办法(实测有效)都记录下来,方便日后学习实践. 1. 系统环境 # cat /etc/ ...

  2. MYSQL5.5源码安装 linux下

    /* 首先安装必要的库 */ yum -y install gcc* ###### 安装 MYSQL ###### 首先安装camke 一.支持YUM,则 yum install -y cmake 二 ...

  3. 烂泥:源码安装apache

    本文由秀依林枫提供友情赞助,首发于烂泥行天下. 最近要开始学习nagios监控方面的知识了,但是nagios与apache结合的比较紧密,所以本篇文章就先把apache的源码安装学习下. 我们现在分以 ...

  4. 在ConoHa上Centos7环境下源码安装部署LNMP

    本文记录了从源码,在Centos 7上手动部署LNMP环境的过程,为了方便以后对nginx和mariadb进行升级,这里采用yum的方式进行安装. 1.建立运行网站和数据库的用户和组 groupadd ...

  5. CentOS7下源码安装mysql5.6

    目录 准备工作 运行环境 确认你的安装版本 下载mysql 安装mysql 准备安装环境 编译和安装 配置mysql 单实例配置      单实例配置方法          添加防火墙         ...

  6. nginx在Centos7.5下源码安装和配置

    安装nginx 安装nginx依赖包 yum install -y pcre-devel zlib-devel openssl-devel wget gcc tree vim 进入目录/root/se ...

  7. CentOS7 下源码安装 python3

    CentOS 7 下源码安装 python3   在CentOS7下,默认安装的是python2.7:为满足项目要求,安装python3 的方法如下:   1. 首先安装python3.6可能使用的依 ...

  8. CentOS7.3环境下源码安装httpd

    CentOS7.3环境下源码安装httpd 本文在CentOS7.3下,源码安装apache服务httpd2.4. 1.下载好源码安装包 [root@localhost ~]#ll total 625 ...

  9. CentOS7下源码安装5.6.23

    清理CentOS7下的MariaDB. [root@localhost ~]#rpm -qa | gremp mariadb     [root@localhost ~]# rpm -e --node ...

随机推荐

  1. Android之自定义(上方标题随ViewPager手势慢慢滑动)

    最近很蛋疼,项目要模仿网易新闻的样式去做.上次把仿网易新闻客户端的下拉刷新写出来了,这次是ViewPager的滑动,同时ViewPager的上面标题下划线跟随者移动,本来通过ViewPager的OnP ...

  2. 《ArcGIS Runtime SDK for Android开发笔记》——问题集:Error:Error: File path too long on Windows, keep below 240 characters

    1.前言 在使用Android Studio开发环境时,经常会爆出以下错误,虽然具体细节内容各有不同,但是说明的都是同一个问题,在windows中使用过长的路径,超过240字符. Error:Erro ...

  3. 使用canvas来绘制折线图

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  4. rel 属性<small>H5保留属性</small>

    源文件

  5. ring0 恢复SSDTHook

    原理: 用ZwQuerySystemInformation 功能号为11(SystemModuleInformation)  得到所有系统模块的地址 遍历搜索得到ntos模块的基地址 读Ntos模块到 ...

  6. cocos2d-x3.1 下实现相似Android下ExpandListView的效果

    在左Android開始有SDK提供ExpandListView的可扩展列表,而在iOS下有很多第三方做好的Demo,这里我是參照iOS下RATreeView这个第三方库实现的. 本文代码:须要在3.1 ...

  7. python:pymysql模块使用

    一,基本使用 # 导入pymysql模块 import pymysql # 连接database conn = pymysql.connect(host=“你的数据库地址”, user=“用户名”,p ...

  8. transform,animate

    1.transform  用来定义变换 IE10及以上支持 示例:transform: rotate | scale | skew | translate |matrix; 一.旋转rotate 正数 ...

  9. 并发队列 – 有界阻塞队列 ArrayBlockingQueue 原理探究

    一.ArrayBlockingQueue类图结构 如图ArrayBlockingQueue内部有个数组items用来存放队列元素,putindex下标标示入队元素下标,takeIndex是出队下标,c ...

  10. python+requests实现接口测试 - get与post请求使用

    简介:Requests 是用Python语言编写,基于 urllib,采用 Apache2 Licensed 开源协议的 HTTP 库.它比 urllib 更加方便,可以节约我们大量的工作,完全满足 ...