exactly
you could alternatively use, not the "standalone" php binary (a CGI exec.) but use the module in Apache (where all server variable would be set the way you said they should in httpd.conf) by using a small C program with the "fopen wrappers", trying to open("http://localhost/her
HTH
Main Topics
Browse All Topics





by: axis_imgPosted on 2002-12-05 at 21:14:22ID: 7540643
Just a quick observation...
en/ reserve d.variable s.php#rese rved.varia bles.serve r
My first thought is that you are running the PHP script via the php binary and bypassing apache (or whatever web server you are using), so DOCUMENT_ROOT should not be set. DOCUMENT_ROOT is a server variable, so for that to be set, I believe you would need to call the script via apache.
http://www.php.net/manual/
I have not tested that theory, but it just sounds like a feasible reason to me. If that is not the case, then I guess try using the globals array instead of the straight variable, in case you do not have register_globals turned on in your config.
For example:
#!/usr/bin/php -qec /usr/local/lib
<?
print "DOCUMENT_ROOT= " . $_SERVER["DOCUMENT_ROOT"] . "\n";
?>
I am not convinced that is going to work though, due to the reasons I stated above. Is this the only variable you were trying to get?
Barry