Centos7下使用yum安装lamp

11 篇文章 0 订阅

使用yum安装lamp

  • yum install epel-release -y 安装源
  • rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm -y
  • yum install httpd -y 安装apache
  • *yum install php70w -y 安装php7
  • yum install php70w-pecl-redis -y yum install php70w-mysql -y 安装redis和mysql扩展
  • yum install mariadb-server -y 安装mysql客户端

额外扩展安装

  • 搜索 yum search php | grep mbstring
  • 安装 yum install php70w-mbstring -y
  • 重启apache systemctl restart httpd

安装环境之后的配置

mariadb 默认密码为空,修改密码
mysql –uroot –p
回车
use mysql
update user set password =password (‘密码’) where user=’root’;
flush privileges;

-

mariadb 设置允许远程连接:
1. 修改表
把user表的host改为%
2. 授权
GRANT ALL PRIVILEGES ON . TO ‘root’@’%’ IDENTIFIED BY ‘123456’ WITH GRANT OPTION;

-

ThinkPHP的Runtime写入问题
1. 可能是系统本身的原因
vim /etc/selinux/config 修改为:
selinux=disabled这里写图片描述
2. Runtime文件夹没有写入权限
Chmod 777 –R * 递归更改权限。

-

Apache重写规则
直接编辑 /etc/httpd/conf/httpd.conf
找到Include conf.modules.d/*.conf 把所有的配置文件加载进来
在此行的内容下添加:重写规则
LoadModule rewrite_module modules/mod_rewrite.so
继续找到以下内容:
1.
Options Indexes FollowSymLinks
2. #
3. # AllowOverride controls what directives may be placed in .htaccess files.
4. # It can be “All”, “None”, or any combination of the keywords:
5. # Options FileInfo AuthConfig Limit
6. #
7. AllowOverride None
将此处的AllowOverride None修改为AllowOverride all。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

闲不住的程序员

您的打赏将是我最大的鼓励感谢

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值