emptygif
Basa: Basa Jawa

Kabeh basa lan framework

Plain PHP (php-fpm, mod_php, php -S) PHP

Snippet PHP kanggo Plain PHP (php-fpm, mod_php, php -S) sing mangsuli request menyang /pixel.gif nganggo empty GIF, sing didekode sepisan nalika startup.

Plain PHP (php-fpm, mod_php, php -S) PHP

File
index.php
Lakokake
php -S 0.0.0.0:8080 index.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;

Snippet iki wis dilakokake lan byte asile wis dibandhingake.

Priksa

curl -sI http://localhost:8080/pixel.gif

Situs resmi: Plain PHP (php-fpm, mod_php, php -S)

Liyane ing PHP