I have a WAMP installation on my machine and I am developing a PHP website in that. Can anyone tell me what settings to be changed in order to show all errors / warning messages in the browser?
Thanks in advance
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You need to set both error_reporting and display_errors. These can be set in php.ini, in Apache (if you’re using PHP as an Apache module) or during run-time, though if you set it during run-time then it won’t effect some types of errors, such as parse errors.
For portability – that is, if you want to set this in the application – try setting them in an .htaccess:
Alternatively you could set these in httpd.conf
display_errors makes sure that all reported errors are actually output to the browser (on a live server, it’s typical to log them to a file instead). error_reporting specifies which types errors should be logged/displayed.
For a live server, it’s generally a good idea to not to display errors publicly (but you may still want to log them). Either way, it’s still a good idea to set error_reporting to a more inclusive value (2147483647 being the most inclusive value possible now and for the future according to the PHP docs) because ignoring errors is generally a bad idea.