Re: PHP sockets enabled but socket_create() gives an error call to undefined function

From: Date: Tue, 02 Nov 2010 21:49:15 +0000
Subject: Re: PHP sockets enabled but socket_create() gives an error call to undefined function
References: 1 2 3 4 5 6 7 8 9 10 11 12 13  Groups: php.general 
Request: Send a blank email to php-general+get-309251@lists.php.net to get a copy of this message
On Tue, Nov 2, 2010 at 2:33 PM, Suyash R <r.suyash@gmail.com> wrote: > No, we didn't try it our dept.'s admin wants to know where is sockets.so > file on disk > lol, tell your dept.'s 'admin' to run locate sockets.so > and why should we try this when the phpinfo() displays sockets being > enabled? > probly there is no need to, however you should understand the difference between adding support for and enabling an extension. compiling w/ --enable only makes the extension available. the extension is not enabled unless you do what Nick has been saying. (there are other options as well actually). there may be other files aside from php.ini where this setting is made, depending on how the OS vendors package up the code. for example using mac ports, i just installed sockets and now have a shiny new sockets.ini file. anyway if phpinfo() shows that sockets are enabled you probly don't have to worry about that, because it wouldn't be showing up otherwise (essentially). i'm wondering if you're trying to call socket_create() from the same place you're running phpinfo(). are you sure the socket_create() code isn't running from the cli perhaps? if so, a quick test to see if sockets are enabled on the cli is php -i | grep 'Sockets Support' if nothing comes back sockets aren't enabled for the cli. if that's the case then you will have to head into the appropriate ini file to enable the extension for the cli. or if that's too much for you admin you can always try dl('sockets.so'); at the top of your script. you can also try var_dump(extension_loaded('sockets')); to see if sockets are actually enabled where you're trying to invoke them from. -nathan

« previous php.general (#309251) next »