php.ini Settings
There are a few environment-wide settings that should be considered for each type of server you are using to develop your code. First, we will have a brief summary of what these are, and then we will list the recommended settings for each of the three coding environments.
display_errorsAn on-off toggle that controls the display of any errors encountered by PHP. This should be set to
0(off) for production environments.error_reportingThis is a setting of predefined constants that will report to the error log and/or the web browser any errors that PHP encounters. There are sixteen different individual constants that can be set within this directive and certain ones can be used collectively. The most common ones are
E_ALL, for reporting all errors and warnings of any kind;E_WARNING, for only showing warnings (nonfatal errors) to the browser; andE_DEPRECATED, to display runtime notice warnings about code that will fail in future versions of PHP because some functionality is scheduled to be ended (likeregister_globalswas). An example of these being used in combination would beE_ALL & ~E_NOTICE, which would tell PHP to report all errors except the generated notices. A full listing of these defined constants can be found here: http://www.php.net/manual/en/errorfunc.constants.php.error_logThe path to the location of the error log. The error log is a text-based file located on the server at the path location that records all errors in text form. This could be apache2/logs ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access