php - 将网站上传到主机时出现 Codeigniter 错误
问题描述
我遇到如下错误。网站在本地运行良好,但上传到主机时出现错误。非常感谢!
A PHP Error was encountered
Severity: Warning
Message: is_dir(): open_basedir restriction in effect. File(/var/lib/php/session) is not within the allowed path(s): (/var/www/vhosts/my-website/:/tmp/)
Filename: drivers/Session_files_driver.php
Line Number: 134
Backtrace:
File: /var/www/vhosts/my-website/httpdocs/application/controllers/Trangchu.php
Line: 7
Function: __construct
File: /var/www/vhosts/my-website/httpdocs/index.php
Line: 315
Function: require_once
解决方案
在主机服务器上使用 SSH 登录并编写以下命令:
chmod 755 -R /var/www/vhosts //and push enter
推荐阅读
- javascript - Vue3“在'vue-router'中找不到导出'createWebHistory,createRouter'
- discord - 为什么 discord.js 不允许我在这一行中使用 .then?
- firebase - Firebase rules.MapDiff 是否知道嵌套字段的更改?
- c# - 在 C# 中使用带有 SSH.NET 的字符串中的“OPENSSH”私钥文件失败,并出现“无效的私钥文件”
- xml - Wonderware Archestra IDE 中的 XML 到 TreeView
- python - 如何在 Python 2.x 中创建定义长度的零字符串
- sql - 在postgres中选择日期列等于今天日期的所有行到分钟
- mysql - 无法使用 JPA 查询检索结果
- mysql -
具有多对多关系 - javascript - if 语句中的 Javascript addEventListener(检查状态)