Ura Fag
Ura Fag

Reputation: 9

PHP errors are not shown

I've got an PHP file with an error in it, but I don't know where it is and there is no error reporting, but I enabled error reporting in php.ini and in the script.

Why can't I see the error?

Upvotes: 0

Views: 160

Answers (2)

MaX
MaX

Reputation: 1344

Try enabling errors in PHP:

<?php
error_reporting(E_ALL);
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);

If you still don't see anything and you are using Linux and Apache try looking into /var/log/apache2/error.log you can see the live log tail -f /var/log/apache2/error.log

Upvotes: 0

roberthernandez
roberthernandez

Reputation: 524

Make the first four lines of your page look like this:

<?php
error_reporting(E_ALL);
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);

This will override your error echoing settings elsewhere so you can track down your problem. And of course, don't forget to do a phpinfo(); if you suspect there's a missing or misconfigured dependency.

Upvotes: 3

Related Questions