Plain PHP (php-fpm, mod_php, php -S) PHP
Snippet na PHP don Plain PHP (php-fpm, mod_php, php -S) da ke amsa requests zuwa /pixel.gif da empty GIF, wanda ake decoding ɗinsa sau ɗaya lokacin farawa.
Plain PHP (php-fpm, mod_php, php -S) PHP
<?php
// Front controller: works under php-fpm, Apache mod_php or the built-in server.
if (parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) !== '/pixel.gif') {
http_response_code(404);
return;
}
$gif = base64_decode('R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==');
header('Content-Type: image/gif');
header('Content-Length: ' . strlen($gif));
header('Cache-Control: no-store');
echo $gif;
Mun gudanar da wannan snippet kuma mun kwatanta bytes ɗin da ya mayar.
Duba shi
curl -sI http://localhost:8080/pixel.gif
Shafin hukuma: Plain PHP (php-fpm, mod_php, php -S)