What is PHP7 error "not found or unable to stat"?

Dominik asked:

I am receiving the following error log on my apache2 server:

[Mon Dec 24 09:38:48.580631 2018] [php7:error] [pid 19547] [client] script '/var/www/echo.php' not found or unable to stat, referer: https://www.google.com/
[Mon Dec 24 18:16:33.851584 2018] [php7:error] [pid 19523] [client] script '/var/www/xmlrpc.php' not found or unable to stat
[Tue Dec 25 03:28:48.912986 2018] [php7:error] [pid 19551] [client] script '/var/www/index.php' not found or unable to stat
[Tue Dec 25 04:15:30.013401 2018] [php7:error] [pid 19527] [client] script '/var/www/help.php' not found or unable to stat

I am sure that’s just bruteforcing on existing scripts.
But how can this throw a PHP7 error?
What do the ports mean as I am not using any of those?

My answer:

Apache passed the request to PHP because the URL ended in .php and Apache was configured to do so with an AddHandler directive.

The port number and IP address are of the remote system.

These are being logged because the PHP script corresponding to the URL does not exist or cannot be accessed. A 404 error is returned.

And yes, it looks like automated brute forcing attempts. You can ignore these or enable the relevant fail2ban jail.

View the full question and any other answers on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.