I have a script, that works in background and accepts connections via unix sockets.
So, I've wrote another script, that connects to the first one.
I've checked it from the CLI and everything works just fine.
But when I'm trying to use my second script from the web (php-fpm), I'm getting exception No such file or directory.
This exception is thrown when socket_connect function is invoked.
Sounds like there is no socket file. But it does exist. And I can connect to this socket at that moment with this script but only from CLI.
Any ideas?
UPDATE:
Here is the code:
$filepath = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'checkerd.sock';
$socket = socket_create(AF_UNIX, SOCK_STREAM, null);
$result = socket_connect($socket, $filepath, 0);
if ($result === false) {
print_r(socket_strerror(socket_last_error()));
}