Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
145 views
in Technique[技术] by (71.8m points)

PHP does not display error messages

I installed XAMPP 1.7.4 (with PHP 5.3.5), the problem is PHP does not display any error messages. E.g. if I connect to MYSQL with mysql_connect() without parameters, PHP will not complain about the required fields.

Why is this?

How can I configure PHP to display errors?

question from:https://stackoverflow.com/questions/5680831/php-does-not-display-error-messages

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

To turn on errors at the script level, include at the top of your script:

ini_set('display_errors', 1);
error_reporting(~0);

Alternatively, if it is not a production site and simply a development / testing site, you can turn on error reporting in php.ini. Search it for these settings:

error_reporting  =  E_ALL
;error_reporting  =  E_ERROR
display_errors = On
;display_errors = Off

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...