参考:【四】Centos 7.6 mysql 数据库安装和配置_mrdonghe的博客-CSDN博客_centos7配置数据库
CentOS 7 yum 安装 PHP7.3 教程_laohe08的博客-CSDN博客
centos7 apache无法解析php_Joker_Daddy的博客-CSDN博客_apache不能解析php文件
环境:centos7.6
Apache2.4.6
PHP7.3
MysqL
安装Apacheyum install httpd -ysystemctl start httpd
安装MysqL//myql扩展yum install MysqL MysqL-develwget http://dev.MysqL.com/get/MysqL-community-release-el7-5.noarch.rpmrpm -ivh MysqL-community-release-el7-5.noarch.rpmyum install MysqL-community-serversystemctl start MysqLdsystemctl enable MysqLd//首次登陆MysqL -u root//查看数据库MysqL> show databases;//修改数据root用户密码MysqL> set password for 'root'@'localhost' =password('password');//设置远程登录rootMysqL> grant all privileges on *.* to root@'%'IDentifIEd by 'password';
安装PHP7.3//安装 EPEL 源yum install epel-releaseyum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm //安装yum源管理工具yum install yum-utils//安装PHP7.3yum install -y PHP73-PHP-fpm PHP73-PHP-cli PHP73-PHP-bcmath PHP73-PHP-gd PHP73-PHP-Json PHP73-PHP-mbstring PHP73-PHP-mcrypt PHP73-PHP-MysqLnd PHP73-PHP-opcache PHP73-PHP-pdo PHP73-PHP-pecl-crypto PHP73-PHP-pecl-mcrypt PHP73-PHP-pecl-geoip PHP73-PHP-recode PHP73-PHP-snmp PHP73-PHP-soap PHP73-PHP-xmllsystemctl enable PHP73-PHP-fpmsystemctl start PHP73-PHP-fpm//编辑/etc/opt/remi/PHP73/PHP.ini替换换 ;cgi.fix_pathinfo=1 为 cgi.fix_pathinfo=0 快捷命令sed -i 's/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/' /etc/opt/remi/PHP73/PHP.ini//重启PHP73-PHP-fpmsystemctl restart PHP73-PHP-fpm//验证PHP是否安装成功PHP73 -v注意:使用acache输出PHP文件时候会出现PHP文件解析不了可以将以下内容保存在/etc/httpd/conf.modules.d/10-PHP-fpm.conf<@R_502_6852@sMatch \.PHP$> SetHandler "proxy:fcgi://127.0.0.1:9000"</@R_502_6852@sMatch>
总结 以上是内存溢出为你收集整理的Centos7.6搭建Lamp环境全部内容,希望文章能够帮你解决Centos7.6搭建Lamp环境所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)