PHP and MySQL Web Development - P100

PHP and MySQL Web Development - P100: PHP and MySQL Web Development teaches the reader to develop dynamic, secure, commercial Web sites. Using the same accessible, popular teaching style of the first edition, this best-selling book has been updated to reflect the rapidly changing landscape of MySQL and PHP. | Altering the Error Reporting Settings 467 Altering the Error Reporting Settings You can set the error reporting settings globally in your file or on a per script basis. To alter the error reporting for all scripts you can modify these four lines in the default file error_reporting E_ALL E_NOTICE display_errors On log_errors Off track_errors Off The default global settings are to report all errors except notices output error messages as HTML to standard output not log error messages to disk not track errors storing the error in the variable php_errormsg The most likely change you are to make is to turn the error reporting level up to E_ALL. This will result in many notices being reported for incidents that might indicate an error or might just result from the programmer taking advantage of PHP s weakly typed nature and the fact that it automatically initializes variables to 0. While debugging you might find it useful to set the error_reporting level higher. In production code if you are providing useful error messages of your own it would be more professional looking to turn display_errors off and to turn log_errors on while leaving the error_reporting level will then be able to refer to detailed errors in the logs if problems are reported. Turning track_errors on might help you to deal with errors in your own code rather than letting PHP provide its default functionality. Although PHP provides useful error messages its default behavior looks ugly when things go wrong. By default when a fatal error occurs PHP will output the following br b Error Type b error message in b path b on line b lineNumber b br and stop executing the script. For nonfatal errors the same text is output but execution is allowed to continue. This HTML output makes the error stand out but looks poor. The style of the error message is unlikely to fit the rest of the site s look. It might also result in Netscape users seeing no output at all if the page s content

Không thể tạo bản xem trước, hãy bấm tải xuống
TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.