FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » 404 error
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: 404 error [message #185621 is a reply to message #185619] Tue, 22 April 2014 18:56 Go to previous messageGo to previous message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma:
Senior Member
On 4/22/2014 2:42 PM, Lew Pitcher wrote:
> On Tuesday 22 April 2014 13:32, in comp.lang.php, "Ed Mullen"
> <ejEVOMER(at)edmullen(dot)net> wrote:
>
>> Ed Mullen wrote:
>>> Jerry Stuckle wrote:
>>>> On 4/22/2014 12:41 PM, Ed Mullen wrote:
>>>> > I have two sites on different hosts.
>>>> >
>>>> > Both use identical code to display a "last modified" message. The code
>>>> > is in a standard footer which is included (via PHP) on ever site page.
>>>> >
>>>> > I just noticed something odd. At my site <http://edmullen.net> it
>>>> > works
>>>> > just fine. The first link below shows a standard page with the footer
>>>> > message. The second will produce an error page since the link doesn't
>>>> > exist on the site. On the error page the date info is simply not
>>>> > displayed.
>>>> >
>>>> > <http://edmullen.net/index.php>
>>>> >
>>>> > <http://edmullen.net/bogus.php>
>>>> >
>>>> > Fine so far. The other site has different results.
>>>> >
>>>> > <http://guitarsnotguns.org/>
>>>> >
>>>> > <http://guitarsnotguns.org/rot.php>
>>>> >
>>>> > Notice the error message and incorrect date in the footer.
>>>> >
>>>> > I'm guessing it's a server configuration issue. Any thoughts?
>>>> >
>>>> > BTW, here's the PHP I use on both sites:
>>>> >
>>>> > <?php
>>>> > $current_file_name = ($_SERVER['REQUEST_URI']);
>>>> > $current_path = ($_SERVER['DOCUMENT_ROOT']);
>>>> > $full_name = $current_path.$current_file_name;
>>>> > $last_modified = filemtime($full_name);
>>>> > print("This page last changed: ");
>>>> > print(date("F j, Y - h:i A", $last_modified));
>>>> > ?>
>>>> >
>>>> > Thanks.
>>>> >
>>>>
>>>> If the file doesn't exist, how can you get its time?
>>>>
>>>
>>> Agreed. Not expecting to.
>>>
>>>> It looks like you're including your footer in the failing page, but not
>>>> in the working one. This is not a PHP issue.
>>>>
>>>>
>>>
>>> The footer is in the two good links above. The failing pages above do
>>> not exist: They're links to a non-existant file. Hence the 404 result.
>>>
>>> What I'm asking about is how the two hosts' servers handle it. The
>>> first displays the custom 404 page WITHOUT showing the date in the
>>> footer. No idea why.
>>>
>>> The second host shows the 404 page but throws an error where the "date
>>> modified" info should be. Obviously
>>>
>>
>> Oops. Hit send too fast.
>>
>> I was going to say that obviously there is something different about the
>> servers set up.
>>
>> I agree, it's probably not a PHP issue. Just thought the smart folks
>> here might have an idea.
>
>
> My (semi-educated) guess:
>
> On edmullen.net, your php.ini file sets the error_reporting value to
> E_ERROR, while on guitarsnotguns.org, the php.ini file sets the
> error_reporting value to E_WARNING
>
> E_ERROR settings will halt execution of the php script; if
> filemtime($full_name) encounters a "file not found" error, the script
> stops, and does not execute the subsequent printf() statements.
>
>
> E_WARNING settings will not halt execution of the php script; if
> filemtime($full_name) encounters a "file not found" error, the script
> continues and tries execute the subsequent printf() statements.
>
> Compare the php.ini settings (both explicit and implicit-default) from both
> sites, especially the error_reporting and display_errors values, to see how
> you've set PHP to handle errors.
>
> HTH
>

Incorrect. An error will ALWAYS stop execution of the script, no matter
what the error_reporting value is. And a warning will NEVER stop
execution of the script, no matter what the error_reporting value is.

All this does is control what level of message is reported; it does not
affect execution in any way.

--
==================
Remove the "x" from my email address
Jerry Stuckle
jstucklex(at)attglobal(dot)net
==================
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Use PHP to populate a Mailing list from a webpage
Next Topic: Re: Disaster Mitigation Program - Apr. 27, 2014
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Dec 19 18:13:17 GMT 2024

Total time taken to generate the page: 0.04183 seconds