Re: Is PHP unsuitable for HTML5 WebSockets?

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

 



On Mon, Aug 13, 2012 at 9:01 AM, Jim Lucas <lists@xxxxxxxxx> wrote:
> On 8/12/2012 12:06 PM, BRIAN M. FITZPATRICK wrote:
>>
>> I've looked all over the net and I have been unable to find a concrete
>> answer to this question. I am about to start development on a web
>> application that will need to provide real-time updates of data to user's
>> browsers. WebSockets are ideal for this task.
>>
>> I have read in some places on the net that PHP is not suitable for
>> WebSockets due to it's nature. That WebSockets are designed for long running
>> threads/processes which each maintain multiple event-driven connections,
>> whereas PHP was designed around the short-lived single process procedural
>> paradigm.
>>
>> Yet on the other hand I see lots of guides and libraries (such as
>> http://socketo.me/) on the net that deal with PHP WebSockets. So I don't
>> know what to think at this stage. Is PHP a suitable platform for developing
>> a web application that requires WebSockets?
>>
>
>
> Back in 2007, I wrote a cli php script to run as a socket server for a game
> I was playing at the time.  It has been running on every server I've put
> together since then.  To say that PHP isn't suited to this type of service
> is wrong.
>
> Give it a shot.  Can't hurt to try.
>
> Jim
>

It works fine. There are many socket applications based on PHP. Just
make sure to set the time limit [1] to 0, or your script will halt.

- Matijn

[1] http://www.php.net/set_time_limit

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[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