Chud37
Chud37

Reputation: 5007

Not getting PHP errors?

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!

Upvotes: 1

Views: 1247

Answers (3)

Saurabh Chandra Patel
Saurabh Chandra Patel

Reputation: 13586

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

Upvotes: 0

Michal Przybylowicz
Michal Przybylowicz

Reputation: 1668

You could try to change this lines to get more information from 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

Upvotes: 0

Tom van der Woerdt
Tom van der Woerdt

Reputation: 29965

You should set error_reporting to E_ALL in the php.ini as well: when a parse error occurs (such as a missing semicolon), your error_reporting(E_ALL) won't be used.

Upvotes: 1

Related Questions