1

For some reason on this particular script, which is a copy of a script I use in a lot of other places, I am not getting any PHP errors. It simply shows a blank page, and It took me a long long time to hunt down a missing semi-colon this morning. Why arn't errors showing up?

my PHP.INI for this sub-domain:

display_errors = On
short_open_tag = On
memory_limit = 32M
date.timezone = Europe/Paris

The code at the top of the page:

session_start();

error_reporting(E_ALL);
ini_set('display_errors', '1');

The Sub Domain is set to run PHP as an Apache Module Which is the same as every other domain I use.

So I am not sure why I am not getting errors displayed. Can anyone tell me?

EDIT: This is solved, because the errors I was producing were on the page where I had got the lines: error_reporting(E_ALL); ini_set('display_errors', '1'); written. When I put the error on to a seperate page and included it, I could see the error fine.

I guess that's why they use bootstrapping!

4

3 回答 3

1

您也应该设置error_reporting为 E_ALL php.ini:当发生解析错误(例如缺少分号)时,您error_reporting(E_ALL)将不会被使用。

于 2013-06-24T12:05:33.377 回答
0

您可以尝试更改此行以从 php 获取更多信息:

 ; The display of errors which occur during PHP's startup sequence are handled
 ; separately from display_errors. PHP's default behavior is to suppress those
 ; errors from clients. Turning the display of startup errors on can be useful in
 ; debugging configuration problems. But, it's strongly recommended that you
 ; leave this setting off on production servers.

 display_startup_errors = On

 ; When PHP displays or logs an error, it has the capability of formatting the
 ; error message as HTML for easier reading. This directive controls whether
 ; the error message is formatted as HTML or not.
 ; Note: This directive is hardcoded to Off for the CLI SAPI

 html_errors = On
于 2013-06-24T12:15:38.213 回答
0
error_reporting(E_ALL);
ini_set('display_errors',1);
ini_set('display_startup_errors',1);
于 2013-06-24T12:19:00.723 回答