I was wondering... for PHP.. I want to run it as an app and not in a website form...
I was wondering if anybody know how to make PHP stay open and listen on ports for information being sent to it..
I want to use PHP for designing the server for a chat client in C++ that will be sending messages to it..
so does anybody have any examples of PHP listening on a port and either sending it/something back out or taking certain actions when it receives a response from a chat client?
sorry if the question is a little complex i'm just curious if anybody can help.

P.S. I'm also doing it in PHP cause PHP is portable to linux, mac, windows and can take a lot of abuse from online..

    5 days later

    What you're describing is not a job for PHP.

    The PHP you use on your webserver is not stable if it runs for a long time. It is not meant to do that. If you want to create a cross-platform desktop application with PHP, you should check out PHP-GTK.

    If you want to run chat off of your server, you should check out OpenFire, which is XMPP and does all the tough programming for you!

    OpenFire is a chat server, which you install on your webserver, and you can use any XMPP-compatible program for your client, such as (my favorite) Pidgin, which is cross-platform and works for just about every kind of instant messaging or chat you can think of.

    To do what you were proposing (kind of, not using sockets or listening or anything), have a look at the following links:

      thanks for taking the time to reply I'll take a look at OpenFire and see what I can make of it.. I really appreciate you taking the time

        I agree, OpenFire is a good suggestion. Note that Spark is their companion client, so you may want to consider it if you are setting up an IM network for your organisation, due to possibly better compatibility with the OpenFire server.

          Write a Reply...