linux - php session file deadlock -
in fixing website someone, i've run following problem:
in order process data, calls exec("/usr/bin/php /path/to/file.php input.dat")
, while file.php
gets called contains include("config.php")
, which, in turn, contains call session_start()
.
the problem occurs deadlock waiting flock("/tmp/sess_xxxxxx")
. parent script locks session file, exec
'ed script attempts continue same session, locking file again, getting deadlocked waiting it.
i've tried putting following @ beginning of the exec
'ed script, no avail:
session_save_path("/tmp/alt_session"); session_id("nothing");
obivously there's distinctly absurd calling exec("php ...")
within php script, that's argument day, , not can change here. also, while i'm free change file gets run under exec
, changing config.php
create other headaches i'd prefer avoid.
any other options, or missing important?
there php bug believe relates problem.
in short, solution run session_write_close()
before file_get_contents()
, (which in case exec()
)
Comments
Post a Comment