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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Nov 2, 2010 at 2:33 PM, Suyash R <r.suyash@xxxxxxxxx> 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

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux