0

file.php

<?php

ini_set('display_errors', 0);

if(){
echo 'test';

?>

I want to hide the error and to show the 500.shtml page, but i see the google chrome error page.

// 500.shtml

      <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
    <HTML><HEAD>
    <TITLE>500 Internal Server Error</TITLE>
    </HEAD><BODY>
    <H1>Internal Server Error</H1>
    The server encountered an internal error or misconfiguration and was unable 
to complete your request.<P> Please contact the server administrator and 
inform them of the time the error occurred, and anything you might have 
done that may have caused the error.<P> More information about this 
error may be available in the server error log.<P>
    </BODY></HTML>
4

3 に答える 3

1

Chrome は常に 5xx エラー用の独自のページを表示します。

于 2012-07-07T00:15:54.527 に答える
1

Internet Explorer と Chromeは、エラー ページが 512 バイトより小さいHTTP エラー コード (500 など) を受け取ると、独自のエラー ページを表示します。

エラー ページのサイズを大きくすると、Chrome に表示されるようになります。

于 2012-07-07T00:21:57.597 に答える
-1

もし何か?!

if()

これは次のようになります。

if(isset($_POST))

条件のフックの終わりがないため、最終的なコードは次のとおりです。

<?php

ini_set('display_errors', 0);

if(isset($_POST)){
echo 'test';
}

?>
于 2012-07-07T00:14:18.137 に答える