Referer = HTTP_REFERER
The referer entry in the error log really referes to the page referring to the script (HTTP_REFERER) and not the script where the error actually happend.
Verification
I just tried it by creating a file foo.html
with a hyperlink to a file foo.php
The content of `foo.php
<?php
foobar();
What I get in the Apache error log is:
PHP Fatal error: Call to undefined function foobar() in /var/www/foo.php on line 3, referer: http://localhost/foo.html
How to find out which script caused the error
If the error is nested deep inside an PHP app, the .php file name mentioned would not be identical with the request URI. To find out the request that caused the error, we can look in the access.log
and try to find an entry with the same or similar time and date (it looks that even the time and date can differ, depending on execution time)