Why do PHP error messages contain a link, such as this error:
<b>Warning</b>: preg_match_all() [<a href='function.preg-match-all'>function.preg-match-all</a>]: Delimiter must not be alphanumeric or backslash in <b>/home/www/test.php</b> on line <b>93</b><br />
with this link?:
[<a href='function.preg-match-all'>function.preg-match-all</a>]
Is the assumption that PHP will be configured to put a http://www.php.net/
in front of that URL? Or that a person will have a copy of the PHP documentation on their web server and that by clicking on that link they will be able to access information about the function?
This is just something I've been curious about since it seems that unless the error occurred on php.net, such a link would be useless.
I know it's possible to set up custom error handlers, etc. My question is: Why is this the default behavior of PHP?
Thanks.
A PHP Error occurs when something is wrong in the PHP code. The error can be as simple as a missing semicolon, or as complex as calling an incorrect variable. To efficiently resolve a PHP issue in a script, you must understand what kind of problem is occurring.
By default, PHP sends an error log to the server's logging system or a file, depending on how the error_log configuration is set in the php. ini file. By using the error_log() function you can send error logs to a specified file or a remote destination.
You are able to set docref_root to prepend the URI. it is intended to be used with a local copy of the manual but can used with an external one.
To turn off html errors altogether, set html_errors to 0.
It's indeed supposed to link to php.net, but most default configurations have it turned off. And you are supposed to redirect it to a local manual copy. (Mine has /phpmanual/, where the php-manual package would probably put it; and I believe the package manager would uncomment the option then.)
The option docref_root
in php.ini
can be used to set it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With