What is 'in Unknown on line 0' in php error log

I'm getting multiple warnings in my php-fpm error log such as below:

PHP Warning:  Unknown: failed to open stream: No such file or directory in Unknown on line 0
PHP Warning:  Unknown: Input variables exceeded 1000. To increase the limit change max_input_vars in php.ini. in Unknown on line 0
PHP Warning:  Missing boundary in multipart/form-data POST data in Unknown on line 0

I tried to google these errors but I need to know what 'in Unknown on line 0' exactly mean to better understand the errors above and solve them properly.

1 answer

  • answered 2018-11-08 16:08 axiac

    An error in Unknown on line 0 is triggered by the code that runs before your script starts.

    Such code could be a file configured in php.ini as auto_prepend_file, a PHP extension or by the interpreter's code that prepares the context for your script to run.

    In this case it seems the error is triggered by the PHP code that parses the query string and the request body (for POST requests) and populates $_GET[], $_POST[], $_FILES[] etc.

    The second line of the error message says there are too many variables in the request body (do you generate the form dynamically?).

    The second line says the request body is malformed and it doesn't end as expected.

    All in all, it seems the request is very large (it is larger than the post_max_size) and it contains more than max_input_vars variables.