Reputation: 1263
I am trying to test PHP (7.2) HTML error reporting.
I have downloaded the "Many HTML files" archive from http://php.net/download-docs.php and unpacked it to:
/home/user/public_html/php/manual/php-chunked-xhtml/
In php.ini for apache I have set:
error_reporting = E_ALL
display_errors = On
html_errors = On
docref_root = "/~user/php/manual/php-chunked-xhtml/"
docref_ext = .html
and restarted the apache service.
As a test I do:
printf();
Which yields:
Warning: printf() expects at least 1 parameter, 0 given in /home/user/public_html/test/err.php on line 10
… but it is not linked to the manual pages. Text only.
What am I doing wrong here? Should there not be a link to printf()
?
Edit:
phpinfo()
say settings are as in ini (above). I have also tried to move the manual to /var/www/html/phpmanual
, but same result. I also added
ini_set("html_errors", true);
to the test file, but no change in result.
The manual is browseable.
As for what I expect. Per manual one have:
html_errors boolean
If enabled, error messages will include HTML tags. The format for HTML errors produces clickable messages that direct the user to a page describing the error or function in causing the error. These references are affected by docref_root and docref_ext. If disabled, error message will be solely plain text.
Thought I would get a link to printf()
as per example.
Upvotes: 1
Views: 830
Reputation: 53513
OK found it finally -- the HTML error messages don't include links for all possible errors. For example:
strcmp();
Generates the warning:
Warning: strcmp() expects exactly 2 parameters, 0 given
But there is no link to the strcmp() function page, even though one exists in the documentation pack. (function.strcmp.html)
However, this code:
preg_match('/', null);
Also produces a warning:
Warning: preg_match() [function.preg-match.html]: No ending delimiter '/' found
But this one does include the link. Not sure what the difference is, as they're both E_WARNING level messages and both have doc pages present.
Upvotes: 2