首页 > 解决方案 > 将网站上传到主机时出现 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

标签: phpcodeignitercloud-hosting

解决方案


在主机服务器上使用 SSH 登录并编写以下命令:

chmod 755 -R /var/www/vhosts //and push enter

推荐阅读