I'm trying to get an http response from this script in a browser, why doesn’t it work?
$http = "HTTP/1.1 404 Not Found";
$http .= "Host: localhost";
$http .= "Connection: close";
$sock = socket_create(AF_INET, SOCK_STREAM, 0);
socket_bind($sock, '0.0.0.0', 80);
socket_listen($sock);
while (1 == 1)
{
$s = socket_accept($sock);
socket_write($s,$http,strlen($http));
}