fcgi_client icon indicating copy to clipboard operation
fcgi_client copied to clipboard

How to handle "Primary script unknown" error from php-fpm

Open valichek opened this issue 9 years ago • 2 comments

Now we get malformed MIME header line: Primary script unknown error on response like:

Primary script unknown
Status: 404 Not Found
X-Powered-By: PHP/7.0.1
Content-type: text/html; charset=UTF-8

File not found.

It's not obvious how to handle it, now we can just search for Primary script unknown and manually create http.Response with 404.

The response is "almost" valid. Would be nice to get normal http response with 404 status from fcgiclient.

valichek avatar Jan 04 '16 12:01 valichek

can you provide reproduce procedures?

tomasen avatar Jan 17 '16 11:01 tomasen

Sure. First, run php-fpm. It is simple with docker. docker run --name some-test -p 9000:9000 php:fpm Then you just connect to it (php-fpm should be running on 9000 port of docker host) and send some request to the script that doen't exist env["SCRIPT_FILENAME"] = "/path/to/not-existing.php" php-fpm should reply with message that contains Primary script unknown at first line

valichek avatar Jan 18 '16 07:01 valichek