Moved to PS, sockets not working

Moved to PS, sockets not working

Posted by: doblesena
Posted on: 2009-10-06 06:29:00

I recently moved to a PS and wrote a test program to see if socket functions where available but got an error:

Call to undefined function socket_create()

How can I activate socket use in my PS ?

That was the only purpose of moving to a PS.



Re: Moved to PS, sockets not working

Posted by: andrewf
Posted on: 2009-10-06 11:27:00

Sounds like the PHP sockets module isn't part of our default install. You'll probably have to build it yourself:

http://wiki.dreamhost.com/Installing_PHP5

Re: Moved to PS, sockets not working

Posted by: doblesena
Posted on: 2009-10-06 12:25:00

It looks disabled in my php.ini file

;extension=php_sockets.dll

How can I modify the php.ini if it doesn't let me with a "permission denied" message?

Re: Moved to PS, sockets not working

Posted by: sXi
Posted on: 2009-10-06 13:05:00

In reply to:

;extension=php_sockets.dll


That's for Windoze mate wink

As andrewf has already suggested, you'll need to build PHP with --enable-sockets.




How To Install PHP.INI / ionCube on DreamHost

Re: Moved to PS, sockets not working

Posted by: andrewf
Posted on: 2009-10-06 13:06:00

That line is Windows-specific (Linux PHP modules end in ".so", not ".dll")... uncommenting it won't fix anything. You will need to build your own PHP to get sockets support.

Re: Moved to PS, sockets not working

Posted by: doblesena
Posted on: 2009-10-06 13:48:00

Oh I see, hmm, guess I'm SOL since I know nothing about SSH, much less about rebuilding php.

Re: Moved to PS, sockets not working

Posted by: sXi
Posted on: 2009-10-06 14:46:00

Yeah, shell can be a bit unnerving at first. I'll knock up an auto-installer that builds a complete PHP environment on DreamHost servers. If you don't mind playing the guinea pig I'll sling you a copy (later today sometime).

Process will be: upload php file, open in browser, wait for success email.




How To Install PHP.INI / ionCube on DreamHost

Re: Moved to PS, sockets not working

Posted by: doblesena
Posted on: 2009-10-06 16:05:00

Thanks sXi but I moved back to shared hosting, see, PS is not for me, all I wanted was socket availability not full root access to tweak my dream host (pun).

Perhaps in the future when I have more time to learn new stuff.

Thanks anyway.

Tags: call to undefined functionsockets