首先安装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

最新文章

  1. splice() 方法向/从数组中添加/删除项目,然后返回被删除的项目
  2. tn文本分析语言(四) 实现自然语言计算器
  3. monkeyrunner之测试结果判断(八)
  4. ubuntu下MySQL中文乱码(新版本Mysql修改方法)
  5. Android扫盲教程大全经典教程全分享
  6. arcgis中DEM如何生成等高线
  7. HDU 1062 Text Reverse(水题,字符串处理)
  8. iOS 转载一篇日期处理文章
  9. Codeforces 741A:Arpa&#39;s loud Owf and Mehrdad&#39;s evil plan(LCM+思维)
  10. Win7中使用Eclipse连接虚拟机中的Ubuntu中的Hadoop2.4&amp;lt;3&amp;gt;
  11. MAVEN 工程打包resources目录外的更多资源文件
  12. C语言结构体占用空间内存大小解析
  13. C++异常处理的编程方法(阿愚,整整29集)
  14. 201521123039《Java程序设计》第十三周学习总结
  15. DataGrid 得到DataGridRow 和DataGridColumn
  16. java加密解密
  17. Cs231n课堂内容记录-Lecture 4-Part2 神经网络
  18. Appium Hybrid混合应用测试——Native切换WebView
  19. Android-----application的学习
  20. 几种Bean的复制方法性能比较

热门文章

  1. Shader Example
  2. solidity语言3
  3. python 整形方法
  4. 【[NOI2003]文本编辑器】
  5. 【[ZJOI2010]网络扩容】
  6. 课堂笔记-------字符串类型string------练习
  7. POJ 1190 生日蛋糕 【DFS + 极限剪枝】
  8. LOJ 2172 「FJOI2016」所有公共子序列问题——序列自动机
  9. Struts2学习笔记——Struts2搭建和第一个小程序
  10. 八、IntelliJ IDEA 缓存和索引的介绍及清理方法