Re: PHP fsockopen with the UNIX abstract namespace
| From: | Jochem Maas | Date: | Wed, 13 Feb 2008 19:52:56 +0000 |
| Subject: | Re: PHP fsockopen with the UNIX abstract namespace | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-269258@lists.php.net to get a copy of this message | ||
@4u schreef:
Hi, I have a problem with fsockopen in connection with the UNIX abstract namespace. To open a UNIX socket in the abstract namespace I have to add a nul byte in front of the path. Unfortunately PHP returns fsockopen() [function.fsockopen]: unable to connect to unix://:0 (Connection refused) for unix://\x00/tmp/dbus-whatever which is a bit strange because I expected at least the error message "fsockopen() [function.fsockopen]: unable to connect to unix://[NUL byte]/tmp/dbus-whatever:0 (Connection refused)"your problem might be version related, but php does have a C level function php_stream_sock_open_unix() explicitly for the issue of the NUL byte (the NUL byte is seen as the end of a string, unless the string handling is binary safe - if I got the lingo correct). my first guess would be to use socket_create() in combination with socket_connect() instead of fsockopen() and see if that does the trick.
Is this a known issue or do I have to set something in the php.ini? I would appreciate any ideas how to debug this issue.