How to: PHP XMLSocketServer

I want to create a chat like application with the help of PHP and Flash;

I have searched a lot and looked the tutorial in kirupa also.
I understood the working, code; but not the installation and setup;

Most of them are for windows…

My hosting service is Linux and my testing service is windows.

Actually I need a very simple understandable code to test whether it is working in both my services. Then only I expand it to my needs.

I have a doubt with that first line #!/usr/bin/php -q. How do I know what is to put here.
And also localhost ip, address in both flash and PHP.

Please help me. I really need this… Some simple helps and if it is working I can try to do some extras…