centos7.6下安装LAMP环境(linux+nginx+mysql5.7+PHP)

忙活了好久好久。。不断解决错误提示。。终于把网站部署上centos了。。留下博客做纪念。

一、安装

安装nginx、php:https://blog.csdn.net/qq_41451303/article/details/104180607

安装mysql:https://blog.csdn.net/qq_38591756/article/details/82958333

其中mysql使用的是mysql5.7

二、部署thinkphp5.1项目失败

session_start(): open(...) failed: Permission denied (13)

给报错的文件夹添加权限

chmod 777 文件夹

 

thinkphp5.1只能显示根网页,所有链接404

vim /etc/nginx/conf.d/default.conf

location中添加:

 location / {
          if (!-e $request_filename) {
                rewrite  ^(.*)$  /index.php?s=$1  last;
                break;
         }

}

A session is active. You cannot change the session module's ini settings at this time

/etc/php.ini中

session.auto_start = 0

 

猜你喜欢

转载自www.cnblogs.com/first-bloodlalala/p/12521335.html