Zend Framework中的Zend_Session_Exception错误

时间:2022-10-09 23:31:22

I have a website in zend framework which is install in another server. Now I have purchase a new server in ubuntu with Zend Engine 2.3.0 . I have installed Apache server, MYSQL , PHPMYADMIN Tool on this server. Then I upload all the files on previous server to the new server. I have also change the urls in the index.php files.

我在zend框架中有一个安装在另一台服务器上的网站。现在我已经使用Zend Engine 2.3.0在ubuntu中购买了一台新服务器。我在这台服务器上安装了Apache服务器,MYSQL,PHPMYADMIN工具。然后我将以前服务器上的所有文件上传到新服务器。我还更改了index.php文件中的url。

But it is giving me error. **Uncaught exception 'Zend_Session_Exception' with message 'Zend_Session::start() - /var/www/sample/library/Zend/Session.php(Line:477):Error #2 session_start(): open(/vlk_session/sess_ielitiholu4219p3nph6lkk8n6, O_RDWR) failed: No such file or directory (2) /var/www/videoliked/library/Zend/Session.php(Line:487): **

但它给了我错误。 **未捕获的异常'Zend_Session_Exception',消息'Zend_Session :: start() - /var/www/sample/library/Zend/Session.php(Line:477):Error#2 session_start():open(/ vlk_session / sess_ielitiholu4219p3nph6lkk8n6 ,O_RDWR)失败:没有这样的文件或目录(2)/var/www/videoliked/library/Zend/Session.php(Line:487):**

This is my below code of index.php file

这是我的index.php文件的下面代码

    Zend_Layout::startMvc($options);

Zend_Session::setOptions(array('save_path'=>'/vlk_session'));
if(isset($_COOKIE["Zend_Auth_RememberMe"]) && $_COOKIE["Zend_Auth_RememberMe"] !== false){
    Zend_Session::rememberMe("5302000");
    setcookie("Zend_Auth_RememberMe", false, time(), "/");
}



if(!Zend_Session::isStarted()){

    Zend_Session::start();

}

1 个解决方案

#1


0  

The save path is absolute.

保存路径是绝对的。

Did you create the folder /vlk_session on your server?

您是否在服务器上创建了文件夹/ vlk_session?

I'd suggest to use and create

我建议使用和创建

/tmp/vlk_session

Instead, or lookup the PHP default folder for sessions in your php.ini and use the one suggested by vendor.

相反,或者在php.ini中查找会话的PHP默认文件夹,并使用供应商建议的那个。

Update:

Make sure the PHP instance is allowed to read/write that folder.

确保允许PHP实例读/写该文件夹。

#1


0  

The save path is absolute.

保存路径是绝对的。

Did you create the folder /vlk_session on your server?

您是否在服务器上创建了文件夹/ vlk_session?

I'd suggest to use and create

我建议使用和创建

/tmp/vlk_session

Instead, or lookup the PHP default folder for sessions in your php.ini and use the one suggested by vendor.

相反,或者在php.ini中查找会话的PHP默认文件夹,并使用供应商建议的那个。

Update:

Make sure the PHP instance is allowed to read/write that folder.

确保允许PHP实例读/写该文件夹。