0

I'm trying to open a txt file that doesn't exist just to display an error but it doesn't! I already modified my php.ini

error_reporting = E_ALL | E_STRICT
display_errors = On
html_errors = On

but still doesn't work. I haven't experience errors since I used PHP! It just displays nothing if it's not working

5
Contributors
5
Replies
7
Views
6 Years
Discussion Span
Last Post by AngelicOne
0

What is the code that should produce error but doesn’t? (any suppression error marks ? )

Also is any error_reporting in your programme or ini_set ?

0

Add this at the top of the .php file that handle the .txt open:

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

Use following code at beginning of your every php pages

ini_set('error_reporting', E_ALL);
error_reporting ( E_ALL );
0

Yep, divyakrishnan has the right idea. To quote the great php.net site:

If the open fails, an error of level E_WARNING is generated.

You COULD just turn on the E_WARNING flag, but it is much better to use E_ALL. It helps you to remind you about declarations, deprecated code, etc.

Hope this helps.

0

Hello. This is a bit late for a reply but why do I need to use the ini_set() function when I already modified the php.ini?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.