现在的位置: 首页 > 综合 > 正文

Session save path Unwriteable(不可写)终极解决方案

2013年07月02日 ⁄ 综合 ⁄ 共 2975字 ⁄ 字号 评论关闭
安装mambo(joomla)时必要项检查出现Session save path Unwriteable(不可写)终极解决方案,供参考使用。当然最好就是找一个支持session路径可写的空间了。因为系统使用环境的不同,有的是本 机搭建,有的是虚拟主机。很多朋友在使用mambo或joomla时候碰到session问题,这里列出一些常见的关于session方面的问题,有关于 安装时出现的错误提示,也有session表损坏等情况。

1 在使用mambo时,不懂为什么,MySQL的哪个mos_session表突然就坏了,网站无法访问。

比较笨一点的办法是那个表出错,你就用phpmyadmin删除了,再建,或选中它,在页面底部选择修复就可以,当然也可以在phpmyadmin 中选中mysql输入 REPAIR TABLE `mos_session` ,执行后,就可以了。出现故障原因未知,有的人从没碰到,有的人一个月都要损坏一两次。

2 我在本装了mambo可以进去,但是装到我的虚拟主机就不行了,输入用户名和密码后还是显示登陆页面!也没有任何错误提示!我又不可能改虚拟主机的配置!在安装的时候自检提示Session save path Unwriteable(不可写)。

要区分看,有时候一些虚拟主机session保存路径安装时提示不可写,但实际上它的权限是770,即对用户和组都是开放可写的,只是对公众不开 放,这时候尽管提示不可写,但系统完全正常运行。很不幸,如果你的主机不是这种情况,就需要用到下面的特别方法了。 (针对joomla应该也可以应用此方法)

原文见:http://forum.mamboserver.com/archive/index.php/t-53532.html%3Cbr%20/t-19284.html

Hi. I think I may have found a solution. I'm trying it out now...what I did is change the installation/index.php file.

If you open this file then add

ini_set('session.save_path',"mambodirectory/yourtempdir"); at the beginning in the php section so the file looks

like this:
--------------------------------------
<?php
/**
* @version $Id: index.php,v 1.5 2005/01/23 03:24:16 kochp Exp $
* @package Mambo
* @copyright (C) 2000 - 2005 Miro International Pty Ltd
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
* Mambo is Free Software
*/
/* Set the session path */
ini_set('session.save_path',"mambodirectory/yourtempdir");

if (file_exists( "../configuration.php" ) && filesize( "../configuration.php" ) > 10) {
----------------------------------------

Mambodirectory is the directory for your mambo installation.
You will need to find out from your hosting provider what the "mambodirectory" is. For my hosting provider

which is Neureal it is "C:/hshome/youraccount/"

"yourtempdir" needs to be a new directory in your mambo folder. This also has to be a readable/writeable folder.

Fingers crossed :)

You will also need to add:

ini_set('session.save_path',"mambodirectory/yourtempdir");

to the configuration.php file.

There is an easier way. you can edit the php.ini file, which dictactes this. Its under [Session] and you add the folder to session.save_path =

just set that to your document root and a subfolder that can have read/write permissions.

翻译过来就是:
把这个问题翻译一下了:
首先是安装之前,打开installation/index.php文件,在开头加上:

ini_set('session.save_path',"mambodirectory/yourtempdir");

开起来是这样的:
--------------------------------------
<?php
/**
* @version $Id: index.php,v 1.5 2005/01/23 03:24:16 kochp Exp $
* @package Mambo
* @copyright (C) 2000 - 2005 Miro International Pty Ltd
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
* Mambo is Free Software
*/
/* Set the session path */
ini_set('session.save_path',"mambodirectory/yourtempdir");

if (file_exists( "../configuration.php" ) && filesize( "../configuration.php" ) > 10) {
...
----------------------------------------
Mambodirectory是mambo的根目录,
比如像这样:"C:/hshome/youraccount/"

"yourtempdir" 是在mambo的根目录下创建的一个新目录(自己建). 当然需要有读写权限。安装完成以后,别忘了在configuration.php文件中加入
ini_set('session.save_path',"mambodirectory/yourtempdir");

里面的值上面解释过了

3 在freebsd下安装其它插件都成功,就是session设置不可写,安装完成后无法进入后台管理系统,提示session()字端出错,修改 php.ini文件指定session.save_path = /tmp,将其文件夹下的属性改为777,还是没用,求救!!!!
要重启 apache 才生效。

4 mos_session 表能否清空?占了那么大的空间,真是太浪费了。能否不宝期到phpmyadmin里清空呢?
mambo会定时删除该表记录 。

 

抱歉!评论已关闭.