Page 1 of 1
Warning: session_start() [function.session-start]
Posted: Fri Oct 16, 2009 4:29 pm
by M.Fidan
1) Warning: session_start() [function.session-start]: open(/var/lib/php/session/sess_o3i1bsba2kbcaha17q8hmc55m7, O_RDWR) failed: Permission denied (13) in /var/www/vhosts/site/httpdocs/system/library/session.php on line 11
2) Warning: Unknown: open(/var/lib/php/session/sess_o3i1bsba2kbcaha17q8hmc55m7, O_RDWR) failed: Permission denied (13) in Unknown on line 0Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/lib/php/session) in Unknown on line 0
HELP ME

Re: Warning: session_start() [function.session-start]
Posted: Sat Oct 17, 2009 12:14 am
by Daniel
your session tmp direct does not have the corrct permissions.
you need to configure your server properly for opencart to work.
Re: Warning: session_start() [function.session-start]
Posted: Tue Oct 12, 2010 8:30 am
by Joe
For anyone else having this problem, try deleting session data from your browser. Under some circumstances PHP may not be able to access and old session but it may still be able to create a new one. This might happen if you changed the way Apache launches PHP, for example.
Re: Warning: session_start() [function.session-start]
Posted: Mon Nov 15, 2010 2:45 am
by sudhir
opencart uses "/var/lib/php/session" for storing session, one has to set permission for this folder.
Usually web server user (apache) will have write access to /var/lib/php/session folder, but opencart runs with user credentials of ftp which is used to upload file.
if one can change the session folder to <user-home>/tmp folder, or make sessions folder part of opencart and use this folder for storing sessions.
Request OC team to make necessary changes, as most shared host users will not have access to change permission for "/var/lib/php/session"
Adding below line to file system/library/session.php , created tmp folder document root folder, Resolved the problem.
Code: Select all
session_save_path(realpath(dirname($_SERVER['DOCUMENT_ROOT']) . '/../tmp'));
Re: Warning: session_start() [function.session-start]
Posted: Thu Nov 18, 2010 4:13 am
by Daniel
opencart does not use /var/lib/php/session.
its what ever the session directory is set to in the php.ini or conf file that is used when php was installed.
Re: Warning: session_start() [function.session-start]
Posted: Fri Feb 11, 2011 10:46 pm
by xtr3mx7
I had same problem with the var/lib/tmp... but suggestion from Sudhir helps here

Thanks a lot Sudhir.
Re: Warning: session_start() [function.session-start]
Posted: Thu Jun 14, 2012 3:20 am
by wcraft
sudhir wrote:Adding below line to file system/library/session.php , created tmp folder document root folder, Resolved the problem.
Code: Select all
session_save_path(realpath(dirname($_SERVER['DOCUMENT_ROOT']) . '/../tmp'));
This worked for me. Additionally, for anyone else stumling upon this issue and having to setup OpenCart in a multiple-server cluster environment for load-balancing and HA, this is a good mod to re-write sessions to an NFS, Ceph, GlusterFS, or similar sharepoint.
I also like having this set within the OpenCart environment because I have other apps on the same servers that don't need tmp folders shared between servers. So one-size fits all, such as the default PHP.ini config isn't applicable in all cases.
For the OC dev team, adding this as an optional configuration within the config.php would be a nice-to-have.
Thanks sudhir.
Re: Warning: session_start() [function.session-start]
Posted: Sat Jul 14, 2012 10:11 pm
by dlo80
@wcraft,
I also have my OC running in a cluster environment for load balancing. Now i'm facing an issue during the checkout, cause most of the time when switching from http to https, the server also changes. And then it's not possible to complete the checkout. Is this also a solution for my situation? => '
Code: Select all
session_save_path(realpath(dirname($_SERVER['DOCUMENT_ROOT']) . '/../tmp'));
'
Let me know!
wcraft wrote:sudhir wrote:Adding below line to file system/library/session.php , created tmp folder document root folder, Resolved the problem.
Code: Select all
session_save_path(realpath(dirname($_SERVER['DOCUMENT_ROOT']) . '/../tmp'));
This worked for me. Additionally, for anyone else stumling upon this issue and having to setup OpenCart in a multiple-server cluster environment for load-balancing and HA, this is a good mod to re-write sessions to an NFS, Ceph, GlusterFS, or similar sharepoint.
I also like having this set within the OpenCart environment because I have other apps on the same servers that don't need tmp folders shared between servers. So one-size fits all, such as the default PHP.ini config isn't applicable in all cases.
For the OC dev team, adding this as an optional configuration within the config.php would be a nice-to-have.
Thanks sudhir.
Re: Warning: session_start() [function.session-start]
Posted: Thu Aug 01, 2013 4:44 pm
by olstar
This worked for me too.

Re: Warning: session_start() [function.session-start]
Posted: Tue Sep 06, 2016 6:01 am
by haxcop
First as it says @daniel is a permission error which can easily be solved
It happens to me on EC2
Login to your host over ssh and
sudo chown -R root:[YOUR_GROUP] /PATH/TO/php/5.6/session
sudo chmod 2775 /PATH/TO/php/5.6/session
find /PATH/TO/php/5.6/session -type d -exec sudo chmod 2775 {} \;
Wala!! Works
Please support other
