Where are the errors?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
MarK (CZ)
Forum Contributor
Posts: 239
Joined: Tue Apr 13, 2004 12:51 am
Location: Prague (CZ) / Vienna (A)
Contact:

Where are the errors?

Post by MarK (CZ) »

I'm probably just stupid but I can't find our why there are no warnings / error reports in my scripts. It's probably just something stupid but it complicates my work.

Code: Select all

<?php

echo error_reporting();

echo "<br><br>Division by null: ";
$i = 10/0;

echo "<br><br>Non-existent function: ";
$var = NonExistentFunction("text");

?>
outputs:

Code: Select all

2047

Division by null: 

Non-existent function:
Thx for your time
rehfeld
Forum Regular
Posts: 741
Joined: Mon Oct 18, 2004 8:14 pm

Post by rehfeld »

error_reporting(E_ALL);

dont echo it
User avatar
MarK (CZ)
Forum Contributor
Posts: 239
Joined: Tue Apr 13, 2004 12:51 am
Location: Prague (CZ) / Vienna (A)
Contact:

Post by MarK (CZ) »

Constant E_ALL has the value 2047. I'm echoing it to show that I have E_ALL already turned on.
rehfeld
Forum Regular
Posts: 741
Joined: Mon Oct 18, 2004 8:14 pm

Post by rehfeld »

oh ok :)

maybe display errors is turned off

ini_set('display_errors', 1);
User avatar
MarK (CZ)
Forum Contributor
Posts: 239
Joined: Tue Apr 13, 2004 12:51 am
Location: Prague (CZ) / Vienna (A)
Contact:

Post by MarK (CZ) »

Ah, that was it! I thought there is only error_reporting. Thanks!
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Never hurts to take a look in your php.ini and become familiar with the options and what they affect
Post Reply