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 5:49 PM, Nathan Nobbe <quickshiftin@xxxxxxxxx> wrote:

> 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
>

yeah he couldn't find it either. He mentioned it's not in the php extensions
so I am looking for way to install it or add it.

>
>
>>  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?
>

yes to see the errors we ran it at cli. The browser page with sockets code
is just blank.

>
> if so, a quick test to see if sockets are enabled on the cli is
>
> php -i | grep 'Sockets Support'
>

Yeah, this gives no results. Hence, I think sockets are not enabled yet as
sockets.so is missing.

>
> 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'));
>
>
When I add this line (dl('sockets.so');) to the top of my script I get the
following error:


PHP Warning:  dl(): Unable to load dynamic library './sockets.so' - ld.so.1:
php: fatal: ./sockets.so: open failed: No such file or directory in
/..../r.php on line 2
PHP Fatal error:  Call to undefined function socket_create() in
/.....r.php on line 24

When I add this line (var_dump(extension_loaded('sockets'));) to the top of
my script:
bool(false)
PHP Fatal error:  Call to undefined function socket_create() in
/....../r.php on line 24

to see if sockets are actually enabled where you're trying to invoke them
> from.
>
> -nathan
>
Can I get any help on how to add or install sockets.so to the php
extensions...

-Suyash

[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