PHP 8.5.0 Alpha 4 available for testing

Voting

: seven plus two?
(Example: nine)

The Note You're Voting On

nicholas at nicholaswilliams dot net
16 years ago
For those wanting to use stream_socket_client() to connect to a local UNIX socket who can't find documentation on how to do it, here's a (rough) example:

<?php

$sock
= stream_socket_client('unix:///full/path/to/my/socket.sock', $errno, $errstr);

fwrite($sock, 'SOME COMMAND'."\r\n");

echo
fread($sock, 4096)."\n";

fclose($sock);

?>

<< Back to user notes page

To Top