Running Apache with PHP as FastCGI.
serverinfo.php:
if (isset($_GET['session'])) {
session_id($_GET['session']);
session_start();
die('You got here');
}
i won't even get to session_start() because session_id() will hang the "thread". This is the scenario:
Page [serverinfo.php] shows server info, where you can update info as well. When updating the info, a AJAX call is made to [update.php], when everything is updated [update.php] is supposed to return the same data shown in [serverinfo.php] just to "refresh" the "page" with the new data, this is done by:
update.php:
if($update) {
$serverinfo = file_get_contents('http://127.0.0.1/serverinfo.php?session=' . session_id() . '&name=' . $_GET['name']);
print $serverinfo;
}
The reason why i want to re-use the internal $_SESSION is because i need to access data about the client for a specific session, such as username and other important data. Otherwise serverinfo.php will just give me: "Login!" which it's supposed to do :)
I could do: include_once('serverinfo.php'); and pass the $_GET data some how but i'm not quite sure if that would work or be all that efficient :)
Accesslog from Apache:
127.0.0.1 - - [15/Feb/2012:11:03:15 +0100] "GET update.php?source=serverinfo&name=test HTTP/1.1" 500 544
127.0.0.1 - - [15/Feb/2012:11:03:15 +0100] "GET serverinfo.php?session=<session_id>&name=test HTTP/1.0" 500 544
This simply shows that update.php actually completes it's updates and tries to call serverinfo.php but it fails with Internal Server error.
apache error log:
[Wed Feb 15 11:03:55 2012] [warn] [client 127.0.0.1] mod_fcgid: read timeout from pipe
[Wed Feb 15 11:03:55 2012] [error] [client 127.0.0.1] Premature end of script headers: serverinfo.php
And here's the global error log:
[Wed Feb 15 11:04:04 2012] [warn] mod_fcgid: process 5584 graceful kill fail, sending SIGKILL