Why do PHP error messages contain a link to the name of the name of the function in their HTML representation?
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&开发者_运维知识库gt;]: 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.
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.
精彩评论