I am helping a friend sort out his contact form. Not sure what's wrong with it yet but noticed that the AJAX request to send the mail returns an error in unknown line 0. Seems pretty weird to me. What would cause PHP to not be able to tell us which file or line is causing the problem?

<br />
<b>Warning</b>:  Unknown: failed to open stream: No such file or directory in <b>Unknown</b> on line <b>0</b><br />
<br />
<b>Fatal error</b>:  Unknown: Failed opening required '/home/user/example.com/filename.php' (include_path='.:/usr/local/lib/php:/usr/local/php5/lib/pear') in <b>Unknown</b> on line <b>0</b><br />

    This is usually something before the main .php file gets requested.

    Is there an auto-prepended .php file (see the auto_prepend_file setting) or is a php debugger being used?

    If this only occurs for an ajax request, perhaps there's something in a .htaccess file or a local php.ini that's triggering the use of an auto_prepend_file setting for the filename.php that's mentioned in the second error.

    Edit: was just able to reproduce this by entering a non-existent filename, abc.php, for the auto_prepend_file setting -

    Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0

    Fatal error: Unknown: Failed opening required 'abc.php' (include_path='C:\xampp\php\PEAR') in Unknown on line 0

      Thanks for your post.

      I think the use of an auto_prepend in this case is extremely unlikely, but I'll look into it.

        Write a Reply...