php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #43086 FastCGI Broken due to session file
Submitted: 2007-10-23 15:37 UTC Modified: 2007-11-01 11:27 UTC
From: davidb at chelsea dot net Assigned: dmitry (profile)
Status: Not a bug Package: CGI/CLI related
PHP Version: 5.2.4 OS: Solaris 2.8
Private report: No CVE-ID: None
 [2007-10-23 15:37 UTC] davidb at chelsea dot net
Description:
------------
PHP 5.2.1 and forward (I think) breaks under the FastCGI/apache proc manager.  When the parent is launched, it fails to open the socket due to trying to open the socket in a directory that doesn't allow it.  If I compare two traces of an older version (5.2.0) and the newer version (running 5.2.4):

Working:

/var/tmp/fastcgi.out:1786:      unlink("session_mm_cgi-fcgi3357.sem")           = 0
/var/tmp/fastcgi.out:1786:      open("session_mm_cgi-fcgi3357.sem", O_RDWR|O_CREAT, 0600) = 3

Broken:

/var/tmp/fastcgi1.out:1648:     unlink("/session_mm_cli4416.sem")               Err#2 ENOENT
/var/tmp/fastcgi1.out:1648:     open("/session_mm_cli4416.sem", O_RDWR|O_CREAT, 0600) Err#13 EACCES

Note that this puts the "/" in place, which is a bad assumption.

Is it possible this is related to bug 42815 in some way?  It's more severe, in that php won't even run, though.

Reproduce code:
---------------
PHP fails to start.

Expected result:
----------------
I think that this should be hard-coded to a /tmp directory, or else somewhere else that the php process will have the ability to write to.  Unless there's a way to fix this behavior with a correct php.ini setup.  We're running with vhosts and suexec, so the owner of the php process manager won't be able to write to the ServerRoot or the root filesystem (nor do we want it to!)


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-10-25 12:28 UTC] jani@php.net
Exactly where does this /var/tmp/fastcgi.out file come from? (It's definately not something PHP outputs!)
 [2007-10-27 22:40 UTC] davidb at chelsea dot net
I thought I updated this, but I don't see my comments.

The /var/tmp/fastcgi files were where I saved the output when running truss on the php processes.  I looked for the session filenames.  Previously, it seems PHP was opening the session file in the cgi-bin directory that the php launch script was located in.  Now, with the "/" in front, it's opening it in the root directory which doesn't work.
 [2007-10-29 14:36 UTC] jani@php.net
Dmitry, can you check this out please?
 [2007-11-01 11:27 UTC] dmitry@php.net
The problem is not releated to CLI/CGI, but to ext/session module and its mm backend.

To fix the behavior set "session.save_path=/tmp" in your php.ini.
Please, reopen the bug if it won't help.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Dec 23 04:01:28 2024 UTC