Codeigniter open_basedir_restriction在共享主机上生效 [英] Codeigniter open_basedir_restriction in effect on shared hosting

查看:260
本文介绍了Codeigniter open_basedir_restriction在共享主机上生效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

严重性:警告

消息:mkdir():open_basedir限制生效。 File()不在允许的路径内:(/ home / thelazyppl /:/ home / thelazyppl:/ tmp:/ usr / local / lib / php /)

Message: mkdir(): open_basedir restriction in effect. File() is not within the allowed path(s): (/home/thelazyppl/:/home/thelazyppl:/tmp:/usr/local/lib/php/)

文件名:drivers / Session_files_drivers.php

Filename: drivers/Session_files_drivers.php

网站的根文件夹是一个wordpress网站,所以我为Codeigniter网站创建了一个名为Bazaar的子域根文件夹。我已经在config.php和wordpress htaccess中设置base_url以允许文件夹Bazaar,但仍然没有什么工作。

The site's root folder is a wordpress website, so i've create a subdomain for the Codeigniter site named "Bazaar" in the root folder. I've already setup the base_url in the config.php and wordpress htaccess to allow the folder "Bazaar" but still nothing is working.

我的主机不允许修改php.ini文件禁用open_basedir,是否有另一种方式允许它或者我在进程中做错了什么?

My host do not allow modifications for the php.ini file to disable open_basedir, is there another way to allow it or did i do something wrong in the process?

推荐答案

您的CodeIgniter安装试图将其会话文件保存到不可写的地方。当您使用共享主机时,我建议您将会话数据存储在数据库中。

Your CodeIgniter installation is trying to save its session files to somewhere that is unwritable. As you're on shared hosting, I would recommend storing your session data in a database.

根据导致错误的文件名,它看起来像是CodeIgniter 3. 用户指南中有一些信息,介绍了如何

Based on the filename causing the error, it looks like you're on CodeIgniter 3. There is some info in the user guide on how to configure it correctly.

要继续使用文件驱动程序,您需要更改 $ config ['sess_save_path']

To keep using the files driver, you will need to change the contents of the $config['sess_save_path'] variable to point it to something like /tmp or /home/thelazyppl/tmp (after you created the tmp folder in your FTP outside your www or public_html directory).

更好的选择是使用数据库驱动程序,详细信息在下面。

The better option would be to use the database driver, for which the details are just below that.

如果你在CodeIgniter 2上遇到这些问题,你肯定需要启用数据库。为此,您可以将 $ config ['sess_use_database'] 选项更改为 TRUE ,然后运行SQL CodeIgniter 2用户指南

If you were having these issues on CodeIgniter 2, you would need definitely need to enable the database. To do this you would change the $config['sess_use_database'] option to TRUE and then run the SQL shown in the CodeIgniter 2 user guide.

这篇关于Codeigniter open_basedir_restriction在共享主机上生效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆