3

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.

3
  • No it can not be wrong. If you enabled it and if it shows that errors are enabled and if you still don't get any errors, then there are no errors. Commented Sep 3, 2015 at 11:42
  • is display_error on in your php.ini file?also try ini_set('display_errors',1); ini_set('display_startup_errors',1); error_reporting(-1); Commented Sep 3, 2015 at 11:45
  • The in file ini_set works fine. But changing the php.ini file doesn't seem to do anything. Phpinfo() still shows display_errors Off. That's why i'm thinking I'm not changing the correct config file Commented Sep 3, 2015 at 11:55

3 Answers 3

5

Enable error reporting at the top of the php page:

ini_set("display_errors", 1);
ini_set("display_startup_errors", 1);
error_reporting(-1);
Sign up to request clarification or add additional context in comments.

1 Comment

As of today, this is the only correct answer on this page.
3

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);

2 Comments

A little bit of overkill to set error_reporting in 3 different ways and display_errors in 2, no?
display_errors and display_startup_errors are two different settings
1

Place this at the top of your page, but be sure to remove it once you have your errors corrected. You don't want the entire world to be able to have insight into your database structure.

<?php
ini_set('display_errors',1); 
error_reporting(E_ALL);
?>

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.