略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: Unix 领域:Unix 和 UDG

2024-04-20

Unix 领域:Unix 和 UDG

unix://自 PHP 3 起可用, udg://自 PHP 5 起可用。

  • unix:///tmp/mysock
  • udg:///tmp/mysock

unix://提供了在 Unix 域中对套接字流连接的访问。 udg://提供了替代的传输器以用户数据报协议(UDP)来访问 Unix 域套接字。

Unix 域套接字(UNIX Domain Socket),和 Internet Domain Socket 不同,不期望端口号。在 fsockopen()portno参数应被设为 0。

add a noteadd a note

User Contributed Notes 1 note

up
12
Matthew Fortune
15 years ago
It appears that fsockopen prior to php5 did not need the unix:// qualifier when opening a unix domain socket:

php4: fsockopen("/tmp/mysocket"......);

php5: fsockopen("unix:///tmp/mysocket"......);

This caught me out when upgrading.

官方地址:https://www.php.net/manual/en/transports.unix.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3