588Part IIIAdvanced Features and TechniquesIf (Affordable web hosting) you do not

588Part IIIAdvanced Features and TechniquesIf you do not want errors to be displayed (and you shouldn t want them displayed on anypublicly accessible machine), the line should read like this: display_errors=OffIf left on in a production server environment, error reporting can result in important detailsof your software being inadvertently displayed to users. For example, an unexpected conditioncould cause the name of a variable or a database table to appear in an unsecured browserwindow. An attacker could use this information to exploit the production server. Figure 32-1shows an error reported as part of the regular output to a browser window. Figure 32-1:Error reporting in browser outputError loggingSimilar in function to error reporting, error logging causes error events to be recorded to atext file, rather than to the screen. It s a more secure option, and because log files should bekept in a directory with limited access, it s the error-recording technique that s preferred forproduction HTTP servers. As is the case with error reporting, error logging is turned on and off in php.ini. To turn iton, use this option: log_errors=OnAlternately, use this: log_errors=OffBy default, error logging is disabled in php.ini. For more detail on error reporting and logging, see Chapter 31. Choosing which errors to report or logWhether you choose to use error reporting (on screen) or error logging (to a file), you can spec- ifywhich errors are considered serious enough to record. In php.ini, the error_reportingvalue defines your logging preference. By default, error_reportingis set like this: error_reporting=E_ALL & ~E_NOTICECross- Reference36
Please visit our professional web hosting services to find out about cheap and reliable webhost service that will surely answer all your demands.

Leave a Reply