socket 實作問題請教

edited 十月 2013 in 進階PHP討論
socket 有問題請教


有個疑問,我裝設easyPHP 1.8版,做php socket的測試時,已經將extension=php_sockets.dll模組打開,在infophp()中 socket 的功能顯示為enable;
但測試 php.exe test_socket.php時還是出現call to undefined function: socket_create(),請教是哪裡出錯了呢? 感謝!

測試的code


<?php
$commonProtocol = getprotobyname("tcp");
$socket = socket_create(AF_INET, SOCK_STREAM, $commonProtocol);
socket_bind($socket, 'localhost', 8080);
socket_listen($socket);

$connection = socket_accept($socket);
if($connection)
{
socket_write($connection, "You have connected to the socket...");
}

原始討論: http://twpug.net/x/modules/newbb/viewtopic.php?topic_id=2567

評論

Sign In or Register to comment.