Answer the question
In order to leave comments, you need to log in
Why doesn't php-fpm + nginx return the generated image?
Hello! There is a site, it has a standard captcha code generation, it worked for many years, I will show only the end, so it is pointless to show the rest:
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
if (!isset($_GET['code']))
header('Content-type: image/jpeg');
imagejpeg($image);
imagedestroy($image);
Answer the question
In order to leave comments, you need to log in
Everything turned out to be banal and simple. \n\r in one of the included files, if it's easier to break the line before displaying the image code.
Also, one of the possible problems, in such a situation, is the UTF-8 with BOM encoding of the file.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question