R
R
Roman Kutenko2012-03-21 12:01:41
Sessions
Roman Kutenko, 2012-03-21 12:01:41

Session_start and Permission denied (13)?

Hello, I have a problem with the server:

Message: Zend_Session::start() - /home/sky/site/public_html/library/Zend/Session.php(Line:469): Error #2 session_start() [function.session-start]: open(/tmp/sess_hks4rn1aagba1j7pfi5gltje12, O_RDWR) failed: Permission denied (13) Array /home/sky/site/public_html/library/Zend/Session.php(Line:479): Error #2 session_write_close() [function.session-write-close]: open(/tmp/sess_hks4rn1aagba1j7pfi5gltje12, O_RDWR) failed: Permission denied (13) Array /home/sky/site/public_html/library/Zend/Session.php(Line:479): Error #2 session_write_close() [function.session-write-close]: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp)

The server is running php-fpm + nginx. In php.ini save_path is correctly specified / tmp, access rights to the folder 777. Already googled, but nothing helps. It doesn't necessarily pop up with Zend, a simple session start sometimes outputs the same thing. Sometimes the session starts normally without errors.

Answer the question

In order to leave comments, you need to log in

6 answer(s)
R
Roman Kutenko, 2012-03-21
@Sky4eg

registered in the pool config and site settings
fastcgi_pass unix:/var/run/php-fpm/sky.sock; instead
of fastcgi_pass 127.0.0.1:9000;
and the problem is gone

C
charon, 2012-03-22
@charon

by the way, access rights 777 on /tmp is an error that can lead to hard-to-diagnose jambs. Correct rights: 1777

A
Anatoly, 2012-03-21
@taliban

Remove save_path, it saves it in tmp by default, and check if you corrected that php.ini. Personally, I have 4 of them, separately for Apache, cli, fpm (/etc/php5/fpm/php.ini) and cgi.

S
Sergey Beresnev, 2012-03-21
@sectus

There is a similar situation

C
charon, 2012-03-21
@charon

1. Don't use /tmp to store sessions. It is better to create a directory in /var. Is that what you don't like about the standard /var/lib/sessions?
2. You still need to find out under which user the script is running. Option: assign this user as the owner of the directory for sessions and give him the right to write. If there are many of these, then drive them into one group and give it the right to write. 3. Check SELinux - disable for testing.
$info = posix_getpwuid(posix_getuid());
$login = $info['name'];

G
gaelpa, 2012-03-21
@gaelpa

Chroot in the fpm config is not registered for an hour?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question