PHP Question

Miscellaneous Forums/General Discussion/PHP Question

Is it possible to create a Instant Messenger server in PHP? If so, are there tutorials or examples anywhere?

Thanks.

Google!

I don't think PHP is an ideal solution for that specific problem, but it can be done with it.

Google found this site for you:
http://www.php-development.ru/software/instant-messenger.php

I found that one aswell, here is another one Google found:
http://www.php121.com/download.php

Are you talking about a server for an instant messenger you wrote? IRC? (more information on what your looking to do would help us help you :P)

Thanks for the links!

Are you talking about a server for an instant messenger you wrote?

Yes. I am going toward PHP stuff because my ISP will not allow me to host my own Blitz server on my computer if others will be trying to connect to it from the outside. Security risk or something.

Is it possible to create a Instant Messenger server in PHP?
While technically possible, doing so would be an example of engineering ingenuity, rather than practical application.

I would definitely do it with something more realtime oriented.
CGI is more likely to be the better choice for this task than PHP is ...

I don't know anything about CGI. Are there any tutorials for what I am wanting to achieve?

Are you looking for a language to do your job or a "my solution in a nutshell" solution.
I assumed you wanted to create something that works performantly and in that manner: no there isn't any as tutorials teach the basics of a language and interaction.

If you understand how CGI works, doing the server won't be hard at all.

If you're planning on a instant messaging service then PHP is not a realistic option. In the end you'd end up polling a database or worse, a flat file for messages and then sending them out to each client. It'll get messy and most of all very server intensive.

As an example, flashchat uses a flash GUI and a php system for chat. Most shared hosting companies hate this script and do not allow it. After about 10 users it can eat crazy resources.

If you're just after a simple one-to-one system it wouldn't be too bad. If you're after something more capable you're better off with something like java.

As a side note, if you're planning on using the hosting you've got at syntaxbomb to do this, dont :p

php is not the right thing. maybee ajax will do that (ajax = php + javascript)
most of these chat scripts are coded in cgi/perl.

You want to push for an instant messenger, not pull. In other words, you don't want the client to have to check for updates, you want the server to send them when they are available.

Thanks everyone. I will do some learning and see what comes up.

@Qube: That was my intention at first but since I guess that it's a no-go then I won't. :)


you want the server to send them when they are available.



Exactly, which is why PHP is not the ideal thing to use :) - Every PHP solution I've seen to messaging is a right system hog unless it's just a one on one. It constantly has to poll for information.


@Qube: That was my intention at first but since I guess that it's a no-go then I won't. :)



Thanks for understanding :)