php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #10744 session_start() "serializes" exec
Submitted: 2001-05-09 04:39 UTC Modified: 2001-05-10 09:13 UTC
From: fperillo at katamail dot com Assigned:
Status: Closed Package: Session related
PHP Version: 4.0.4pl1 OS: Linux Mandrake 7.2
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: fperillo at katamail dot com
New email:
PHP Version: OS:

 

 [2001-05-09 04:39 UTC] fperillo at katamail dot com
Try this in a script:
<?php
  exec( "/bin/sleep 30 >/dev/null 2>&1 </dev/null &" ) ;
  echo "Done !!" ;
?>

Now call it from the browser several time (Reload button). If you type a ps ax command you will see several "sleep 30" processes. Wait all the processes to stop.

Now put session_start() as the first line. Press RELOAD: it completes OK. Now press RELOAD again: it hangs !!! It waits for the sleep to terminate before starting the next !! So if you press RELOAD 10 times you need to wait 300 seconds !!

Is it a normal behaviour ? How can I have a process completely in the background ? 

Francesco
PS: I tried to put the nohup in the exec string with no success 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-05-10 09:13 UTC] derick@php.net
That is by design (for file based session storage at least).

See http://www.php.net/bugs.php?id=6287&edit=1 and
http://bugs.php.net/?id=10675&edit=1

All access to session variables in PHP4 is serialized. If you want to
start some daemon from inside your php script make it to close all
unused file handles at startup or close the session before exec().

oleg
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 03 23:01:30 2024 UTC