And Session_start Permission denied (13)?

Good afternoon, faced a problem on 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 under php-fpm + nginx. In php.ini save_path is correct in /tmp, permissions on the folder 777. Already orgogliosa, but nothing helps. It does not necessarily Zend'ω popping up, the simple start session, sometimes displays the same. Sometimes the session starts fine with no errors.
October 8th 19 at 01:40
6 answers
October 8th 19 at 01:42
Solution
prescribed in the config pool and website settings
location unix:/var/run/php-fpm/sky.sock; instead of
location 127.0.0.1:9000;

and the problem is gone
October 8th 19 at 01:44
by the way, access rights are 777 on /tmp is a bug that can lead to traditionalismum jambs. Correct: 1777
October 8th 19 at 01:46
Get save_path, it is so by default in a tmp store and check whether You are the one php.ini ruled. Personally, I have 4 pieces, one for Apache, cli, fpm (/etc/php5/fpm/php.ini) and cgi.
Although a silly kament, you can see that writes to tmp - aniya.Kertzmann65 commented on October 8th 19 at 01:49
ls-l /tmp this session like no different from other
-rw------- 1 sky sky 101 Mar 21 15:08 sess_hks4rn1aagba1j7pfi5gltje12
the site is powered by user sky, it is configured in /etc/php-fpm.d/site.conf
; Start a new pool named 'www'.
[site.com]
; RPM: apache Choosed to be able to access some dir as httpd
user = sky
; RPM: Keep a group allowed to write in log dir.
group = sky - Reggie.Von commented on October 8th 19 at 01:52
And top You also shows sky?
Piccy.info - Free Image Hosting - aniya.Kertzmann65 commented on October 8th 19 at 01:55
15990 mysql 20 0 808m 55m 6260 S 4.7 0.4 0:05.01 mysqld
24187 sky 20 0 295m 19m 4204 S 1.0 0.1 0:00.69 php-fpm
24208 nginx 20 0 45608 888 2856 S 0.0 1.0 0:00.52 nginx
24171 sky 20 0 290m 3360 17m S 0.7 0.1 0:00.58 php-fpm
24174 sky 20 0 292m 3952 17m S 0.7 0.1 0:00.62 php-fpm - Reggie.Von commented on October 8th 19 at 01:58
Look what I saw on all sites to PHP-FPM running on Skye, on the problem held F5 and see what

24169 sky 20 0 292m 3960 17m S 1.7 0.1 0:00.62 php-fpm
24157 apache 20 0 292m 17m 3952 S 1.3 0.1 0:00.64 php-fpm
24163 sky 20 0 293m 19m 4204 S 1.3 0.1 0:00.70 php-fpm
how can this be? - Reggie.Von commented on October 8th 19 at 02:01
This can be spelled out in the config pool for the troubled website.
And keep F5 — use ps instead of top. - audie_Berge commented on October 8th 19 at 02:04
October 8th 19 at 01:48
October 8th 19 at 01:50
1. Do not use /tmp to store sessions. Better to /var create a directory. Here is what you do not like the standard /var/lib/sessions?
2. You must still find out under what user the script is running. Option:
$info = posix_getpwuid(posix_getuid()); <br> $login = $info['name'];
that's it for this user, assign the owner of the directory for the sessions and put it right on the record. If a lot of these, then pound them into a single group and give the right to write to her.
3. Check out SELinux for the test to disable.
Can't understand why, but the value
_SERVER["USER"] apache
varies periodically with
_SERVER["USER"] sky

Where could I nakosyachil - aniya.Kertzmann65 commented on October 8th 19 at 01:53
Why not use /tmp for sessions? How is it bad? - Reggie.Von commented on October 8th 19 at 01:56
session files a lot, and the number of files in the directory should be minimized. For example, when you start listing files in the directory if a thousand of them, there is a problem. And the /tmp directory is used by many other applications and there are cases when there it is necessary to look — it will be a long time to open, and the damn thing will not find then. - aniya.Kertzmann65 commented on October 8th 19 at 01:59
I don't know why do you have to change the owner of the process, but you can try to add them to one group and to give her the right to write.
Assumption: the owner of any scripts you have Apache, and the other is Skye. Solution:
cd /home/sky/site/public_html/ && chown-R sky * - Reggie.Von commented on October 8th 19 at 02:02
October 8th 19 at 01:52
Chroot in the config fpm is not spelled out by the hour?

Find more questions by tags CentOSSessions* nix-like systems