I have been trying for three days now to enable error reporting in PHP. I have gotten by for a while using the ini_set('display errors' 1);
function until I tried to connect to a DB; it didn’t work. Now, I have enabled error_reporting
, display_startup_errors
, log_errors
without any effect on error reporting. I have changed all five config files (the development ini, production ini, the php.ini file(s) located in php/7.0/cli, php/7.0/fpm, and even the one in apache2 (even though I am running nginx)
I am beginning to doubt my own abilities, any assistance is greatly appreciated.
EDIT: I have used the ini_set function described above in my files, and it worked up until I tried to connect to a DB. I have confirmed that I’ve enabled error reporting for the php.ini file described in the phpinfo() function directory path. No effect whatsoever.
Advertisement
Answer
Because no one particularily gave away the answer, I will just have to post it myself.
I found the error.log file (which indeed is logging all errors on my Nginx server) in this directory: /var/log/nginx/error.log
Hopefully this may help others using Nginx as well, but I still do not understand why the **** the errors aren’t showing up in the browser. I think it is Nginx’s nature to make everything quite complicated.
Perhaps I should develop using Apache and then port it into Nginx when I have more experience — just some thoughts for others who are getting into this as well.
I just wanted to give an update on this: Since upgrading from PHP 7.0.2 <= 7.0.3, I am now able to see the errors that should have been displayed.
EDIT: Don’t delete the contents of that log file, it will screw the whole error reporting. I’m back to nothing now. –