Mailing List Archive

php warnings in Windows port
Hi!

Windows me, Xitami, PHP 4.3.1, wikipedia scripts: source forge dump 29.03

Trying to find out why the submit does not return correctly, I stumbled on
the cgi error log file of Xitami.

I have no idea if there is a relation with the issue, but there are quite a
number of disturbing warnings (they appear in case of opening a page and
modifying it).

This can be because of Xitami, or a wrong php version, or Windows, or
because it is running locally, or of installation errors...

However, if this can explain my submit pb, let me know.

Michel Mouly


PHP Notice: Undefined index: HTTP_ACCEPT_CHARSET in OutputPage.php on
line 388
PHP Warning: date() [<a
href='http://www.php.net/function.date'>function.date</a>]: Unexpected
error in DatabaseFunctions.php on line 117
PHP Warning: Cannot modify header information - headers already sent in
OutputPage.php on line 315
PHP Warning: Cannot modify header information - headers already sent in
OutputPage.php on line 316
PHP Warning: Cannot modify header information - headers already sent in
OutputPage.php on line 322
PHP Warning: Cannot modify header information - headers already sent in
OutputPage.php on line 324
PHP Warning: Cannot modify header information - headers already sent in
OutputPage.php on line 325
PHP Notice: Undefined index: HTTP_X_FORWARDED_FOR in OutputPage.php on
line 460
PHP Notice: Undefined index: HTTP_CLIENT_IP in OutputPage.php on line 462
PHP Notice: Undefined index: HTTP_FROM in OutputPage.php on line 464
PHP Notice: Undefined index: REQUEST_URI in OutputPage.php on line 470
PHP Warning: Cannot modify header information - headers already sent in
OutputPage.php on line 318
PHP Warning: Cannot modify header information - headers already sent in
OutputPage.php on line 319
PHP Warning: Cannot modify header information - headers already sent in
OutputPage.php on line 320
PHP Warning: Cannot modify header information - headers already sent in
OutputPage.php on line 322
PHP Warning: Cannot modify header information - headers already sent in
OutputPage.php on line 324
PHP Warning: Cannot modify header information - headers already sent in
OutputPage.php on line 325
Re: php warnings in Windows port [ In reply to ]
On Wed, 2 Apr 2003, Michel Mouly wrote:
> Windows me, Xitami, PHP 4.3.1, wikipedia scripts: source forge dump 29.03
>
> Trying to find out why the submit does not return correctly, I stumbled on
> the cgi error log file of Xitami.
>
> I have no idea if there is a relation with the issue, but there are quite a
> number of disturbing warnings (they appear in case of opening a page and
> modifying it).
>
> This can be because of Xitami, or a wrong php version, or Windows, or
> because it is running locally, or of installation errors...
>
> However, if this can explain my submit pb, let me know.
>
> Michel Mouly
>
>
> PHP Notice: Undefined index: HTTP_ACCEPT_CHARSET in OutputPage.php on
> line 388

Change the error reporting level in your php configuration to not include
'notices'. These are just telling us that the web server didn't report
certain values from the http headers, so the magic array doesn't contain
anything at those indices. We already know that because it will have
returned NULL instead of a useful string. So, not very helpful. :)

> PHP Warning: date() [<a
> href='http://www.php.net/function.date'>function.date</a>]: Unexpected
> error in DatabaseFunctions.php on line 117

Now that's the kind of error message I hate: "unexpected error"! Almost as
good as "unknown error"...

That's in wfUnix2Timestamp(). I think the only thing that uses this is the
last-modified check in OutputPage::checkLastModified(). You might try
putting some debug checks into that function to check on the input to the
function (make sure strtotime() is working and that the server variable
comes through right).

Also, note that a lot of the time calls may break (returning the wrong
time) if your timezone setting is not at GMT/UTC. I haven't tested that
case.

> PHP Warning: Cannot modify header information - headers already sent in
> OutputPage.php on line 315
> PHP Warning: Cannot modify header information - headers already sent in
> OutputPage.php on line 316
> PHP Warning: Cannot modify header information - headers already sent in
> OutputPage.php on line 322
> PHP Warning: Cannot modify header information - headers already sent in
> OutputPage.php on line 324
> PHP Warning: Cannot modify header information - headers already sent in
> OutputPage.php on line 325

These are all because it already spit out some error messages, and don't
indicate any real problems.

> PHP Notice: Undefined index: HTTP_X_FORWARDED_FOR in OutputPage.php on
> line 460
> PHP Notice: Undefined index: HTTP_CLIENT_IP in OutputPage.php on line 462
> PHP Notice: Undefined index: HTTP_FROM in OutputPage.php on line 464
> PHP Notice: Undefined index: REQUEST_URI in OutputPage.php on line 470

Again, change the error reporting level (see above) to make these go away.

> PHP Warning: Cannot modify header information - headers already sent in
> OutputPage.php on line 318
> PHP Warning: Cannot modify header information - headers already sent in
> OutputPage.php on line 319
> PHP Warning: Cannot modify header information - headers already sent in
> OutputPage.php on line 320
> PHP Warning: Cannot modify header information - headers already sent in
> OutputPage.php on line 322
> PHP Warning: Cannot modify header information - headers already sent in
> OutputPage.php on line 324
> PHP Warning: Cannot modify header information - headers already sent in
> OutputPage.php on line 325

See above.

-- brion vibber (brion @ pobox.com)
Re: php warnings in Windows port [ In reply to ]
Thanks a lot for the help!

$_SERVER("HTTP_IS_MODIFIED_SINCE") is most of the time not set. When I got
a non null value it was:

Tue, 28 Jan 2003 11:24:44 GMT; length=8031

(no idea what the date/time refers to! Possibly in relation with the Upload
file special page...)

When given to strtotime, this returns -1, and date() is no happy.

Removing the part after the semi-column makes strtotime returning a 10
digit string.

I'll patch temporarily my outputpage, adding code to remove anything after
a semi-column...

Any idea about what is happening??

Michel Mouly


> > PHP Warning: date() [<a
> > href='http://www.php.net/function.date'>function.date</a>]: Unexpected
> > error in DatabaseFunctions.php on line 117
>
>Now that's the kind of error message I hate: "unexpected error"! Almost as
>good as "unknown error"...
>
>That's in wfUnix2Timestamp(). I think the only thing that uses this is the
>last-modified check in OutputPage::checkLastModified(). You might try
>putting some debug checks into that function to check on the input to the
>function (make sure strtotime() is working and that the server variable
>comes through right).
>
>Also, note that a lot of the time calls may break (returning the wrong
>time) if your timezone setting is not at GMT/UTC. I haven't tested that
>case.
>
>
>_______________________________________________
>Wikitech-l mailing list
>Wikitech-l@wikipedia.org
>http://www.wikipedia.org/mailman/listinfo/wikitech-l