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

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -