Scripts not being found on windows server
Status: Beta
Brought to you by:
mccabe
Installed via gubed windows installer.
Copied ServerScripts contents to web server document
root directory.
Configured "localsettings.php" per instructions.
Launched windows client.
Opened browser & pointed to index.php
On a windows web server testbench "launch ... test with
Gubed activated" always results in an error message.
i.e.
Unable to find script
(/GubedTest/tests/breakpoints/test.php)
Manual script debug launches from StartSession page
produces same error message for existing scripts.
Does not appear to be able to find scripts relative to the
web server root directory.
Could not find reference to issue in documentation or
web
Logged In: NO
Are you using apache? Are you prefixing the script to debug
with a slash (/myscript.php)?
What is the output of the following script when run from
your document root?
<?php
echo "filename: " . $_SERVER['SCRIPT_FILENAME'] . "<br>";
echo "servername: " . $_SERVER['SERVER_NAME'] . "<br>";
if(function_exists('apache_lookup_uri')) {
echo "apache_lookup_uri exists";
else
echo "apache_lookup_uri does not exist";
}
?>
Thanks,
Aaron
Logged In: YES
user_id=1320319
Aaron, thanks for your response.
I am not running Apache. The environment during testing was
php version 4.3.11 configured as an ISAPI extension on a
Sambar production version 6.0.1 web server, installed on a
machine running Windows 2K. The machine resides on a
non-public intra-net.
I was running the Gubed TestBench script, using the links
present in the left side frame for gubed installation testing.
The script name referenced in the error message included
the / prefix.
The product of the script you listed was:
filename:
servername: 10.145.26.17
apache_lookup_uri does not exist
Additional info from a modification of your script:
value of $_SERVER['SCRIPT_NAME'] was /kitest/test1.php
value of $_SERVER['PATH_TRANSLATED] was
D:/WEBSTRUC/kitest/test1.php
D:/WEBSTRUC is the document root directory
Thanks for your assistance!
Nick
Logged In: NO
Thanks Nick. I'm surprised that $_SERVER['SCRIPT_FILENAME']
isn't set. I would've expected this to be
D:/WEBSTRUC/kitest/test1.php. I think this is the problem.
Try the following workaround in StartSession.php. Replace
this line:
$gbdBase = substr($_SERVER['SCRIPT_FILENAME'], 0,
-strlen($_SERVER['SCRIPT_NAME']));
with:
$gbdBase = substr($_SERVER['SCRIPT_FILENAME'], 0,
-strlen($_SERVER['SCRIPT_NAME']));
if($gbdBase == '')
$gbdBase = substr($_SERVER['PATH_TRANSLATED'], 0,
-strlen($_SERVER['SCRIPT_NAME']));
Thanks,
Aaron
Logged In: YES
user_id=1320319
Aaron,
After making the indicated change, launching one of the
TestBench tests with gubed enabled would produce a page
starting with the following (or something similar)...
PHP Bug error: Array ( [0] => < [1] => ? [2] => Array ( [0] =>
304 [1] => php ) [3] => Array ( [0] => 356 [1] => ) [4] =>
Array ( [0] => 313 [1] => echo ) [5] => Array ( [0] => 356 [1]
=> ) [6] => Array ( [0] => 312 [1] => '' ) [7] => ; [8] => Array (
[0] => 356 [1] => ) [9] => Array ( [0] => 355 [
This kind of output would be interspersed around the normal
html content of the page.
Nick
Logged In: NO
I've found that restarting my web server resolves the
garbage output.
I meant to ask you to run StartSession.php after making the
code change and see if it now works when you submit the name
of a script to debug or if it still gives an error saying
that the script cannot be found. I haven't checked yet but
it's likely that the test bed has the same issue as
StartSession.php (the test bed doesn't use StartSession.php)
where it's trying to use $_SERVER['SCRIPT_FILENAME'] but
should rather be using $_SERVER['PATH_TRANSLATED']
Thanks,
Aaron