Discussion:
Strange server behavior
Jeffry Killen
2014-03-03 02:31:28 UTC
Permalink
Hello;
I have been doing php for some time now and have never encountered
this type
of problem:
I have been trying to trace how much of the script is being run before
the server
terminates it and it does go fairly far along. I have been using print
statements
to trace how far it goes but the page requires a script for processing
form post vars.
In turn the required script requires further scripts. So once I get to
the second level
of included scripts, the print statement will not be active ( it will
not print back to the
browser). So can anyone with knowledge of how Apache interacts with
php shed
some light on this? IE the server terminates a script with:
<p class="err">Access to site, jekillen.com, is temporarily denied</p>

Server problems:

browser src:
1: Hello??...<br />
2: Hello??...<br />
3: Hello??...<br />
this page: /site2013Rev/extras/cms/index.php<br />
<p class="err">Access to site, jekillen.com, is temporarily denied</p>

page script:

$_fileSelf = basename($_SERVER['PHP_SELF']);
if($_fileSelf == 'index.php')
{
$_fileSelf = './';
}
$_FSpth = dirname($_SERVER['SCRIPT_FILENAME']);
$_SERpth = dirname($_SERVER['PHP_SELF']);
$_access = false;
$_subSel = '';
$_scrollTo = ''; // for the sake of javascript scrolling.
$_contentMrkUp = '';
$_router = '';
$_scripts = '';
// set in head for javascript to display in call to console.log()
$_jsTest = '';
// new hidden field post variables creating heirarchy of post variables
$_topLevel = '';
// check for global site access status
print "1: Hello??...<br />\n";
if(file_exists('../../BB_status.php'))
{
print "2: Hello??...<br />\n";
require_once('../../BB_status.php');
print "3: Hello??...<br />\nthis page: ".
$_SERVER['PHP_SELF']."<br />\n";
if($_status == 'down') // $_status in this script is ' <status> '
{
print "Hello??...<br />\n";
print "<p>stat: ".$_status.": Access to site, jekillen.com, is
temporarily denied</p>";
exit;
}
}
else
{
print "Site status file not found. Site is closed to access";
exit;
}
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Aziz Saleh
2014-03-03 02:54:58 UTC
Permalink
Post by Jeffry Killen
Hello;
I have been doing php for some time now and have never encountered this
type
I have been trying to trace how much of the script is being run before the
server
terminates it and it does go fairly far along. I have been using print
statements
to trace how far it goes but the page requires a script for processing
form post vars.
In turn the required script requires further scripts. So once I get to the
second level
of included scripts, the print statement will not be active ( it will not
print back to the
browser). So can anyone with knowledge of how Apache interacts with php
shed
<p class="err">Access to site, jekillen.com, is temporarily denied</p>
1: Hello??...<br />
2: Hello??...<br />
3: Hello??...<br />
this page: /site2013Rev/extras/cms/index.php<br />
<p class="err">Access to site, jekillen.com, is temporarily denied</p>
$_fileSelf = basename($_SERVER['PHP_SELF']);
if($_fileSelf == 'index.php')
{
$_fileSelf = './';
}
$_FSpth = dirname($_SERVER['SCRIPT_FILENAME']);
$_SERpth = dirname($_SERVER['PHP_SELF']);
$_access = false;
$_subSel = '';
$_scrollTo = ''; // for the sake of javascript scrolling.
$_contentMrkUp = '';
$_router = '';
$_scripts = '';
// set in head for javascript to display in call to console.log()
$_jsTest = '';
// new hidden field post variables creating heirarchy of post variables
$_topLevel = '';
// check for global site access status
print "1: Hello??...<br />\n";
if(file_exists('../../BB_status.php'))
{
print "2: Hello??...<br />\n";
require_once('../../BB_status.php');
print "3: Hello??...<br />\nthis page: ".$_SERVER['PHP_SELF']."<br
/>\n";
if($_status == 'down') // $_status in this script is ' <status> '
{
print "Hello??...<br />\n";
print "<p>stat: ".$_status.": Access to site, jekillen.com, is
temporarily denied</p>";
exit;
}
}
else
{
print "Site status file not found. Site is closed to access";
exit;
}
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
You seem to be missing the code after those f statements. From what You
posted, I see that the $_status is not down (since it printed <p
class="err"> as opposed to <p> with no Hello??...<br />\n text) and it is
going on.
Tim Streater
2014-03-03 12:03:00 UTC
Permalink
Post by Jeffry Killen
In turn the required script requires further scripts. So once I get to
the second level of included scripts, the print statement will not be
active (it will not print back to the browser).
What do you mean? Why would a print in the next level of included script not write back to the browser? Or do you mean that you don't have access to those scripts to add a print?
Post by Jeffry Killen
So can anyone with knowledge of how Apache interacts with
<p class="err">Access to site, jekillen.com, is temporarily denied</p>
But this is your string, mostly.

You could print out the value of $_status before entering that second if.
--
Cheers -- Tim
Continue reading on narkive:
Loading...