Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Php display_errors

Tags:

php

apache

I'm trying to make php show errors, right now all I get is a blank page. I've tried changing the php.ini file that seems to be the php configuration file but to no success. Could it be that phpinfo() is wrong about what config file is been loaded? (I did restart apache)

phpinfo Loaded Configuration File -> /etc/php5/apache2/php.ini. I copy-pasted the path and filename so misspelling it is not an issue.

like image 698
mitza Avatar asked Feb 23 '26 03:02

mitza


2 Answers

Enable error reporting at the top of the php page:

ini_set("display_errors", 1);
ini_set("display_startup_errors", 1);
error_reporting(-1);
like image 61
rahul Avatar answered Feb 25 '26 17:02

rahul


do this by using the following code and inside you php.ini file display_errors = on

error_reporting(E_ALL);
ini_set('display_errors',1);
ini_set('error_reporting', E_ALL);
ini_set('display_startup_errors',1);
error_reporting(-1);
like image 21
stackers Avatar answered Feb 25 '26 15:02

stackers