0

I'm trying to enable PHP error output to the browser. phpinfo() shows that the path to php.ini is /etc/httpd/php.ini. So as root I edited it by adding a line:

display_errors = On

I restarted apache and it still didn't work, phpinfo() was showing that display_errors was Off both as local and master values. I rebooted my computer and the problem was still there.

If I add

ini_set("display_errors","1");
ERROR_REPORTING(E_ALL);

to my script it shows the errors, phpinfo() shows that display_errors as local value is On, but I'd like to find out why the php.ini solution isn't working. I don't know if it's relevant, but here's the permission settings to php.ini:

-rw-r--r--  1 root root 48267 Oct 10 00:22 php.ini
liewl
  • 207
  • 1
  • 9

3 Answers3

3

Perhaps directive "display_errors" defined twice in php.ini:

grep -i display_errors /etc/httpd/php.ini
bindbn
  • 5,153
  • 2
  • 26
  • 23
1

As bindbn recommended, checking for duplicate directives in php.ini is a good start - then check the other places PHP configuration directives may be set.

danlefree
  • 2,873
  • 1
  • 18
  • 20
0

You may want to follow Can't get PHP to stop showing errors and php 7 ignores ini files, but claims to load

  1. What is "Loaded Configuration File" -> check that you edit the correct ini-file
  2. check for multiple occurences of display_errors in the same file.
  3. Check permissions on the ini file. The web server needs read access.
  4. php 5 and later: try sudo service php-fpm restart before testing
Titus
  • 261
  • 3
  • 7