|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2009-08-05 04:14 UTC] s dot daudell at boldwebservices dot com
Description:
------------
I just installed a newer version of WAMP, with php 5.3.0 and enabled sockets.
This script has worked fine on older versions of php, but now is coming up with an 'called to undefined function socket_create();' error
Reproduce code:
---------------
//-- Set some variables
$host = "192.168.1.103";
$port = 9001;
//-- Create socket
$socket = socket_create(AF_INET, SOCK_STREAM, 0) or die("Could not create socket\n");
//-- Bind socket to port
socket_bind($socket, $host, $port) or die("Could not bind to socket\n");
echo "Binded to server address: ".$host."\r\n"."On port: ".$port."\r\n\r\n";
//-- Start listening for connections
socket_listen($socket, 3) or die("Could not set up socket listener\n");
echo "Waiting for connections...\r\n";
Expected result:
----------------
It should start listening for raw text to come in on that data.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 08:00:01 2025 UTC |
It's not really loaded if the function doesn't exist, try this: <?php var_dump(extension_loaded("sockets")); ?>