I have a fairly basic question, but it’s been driving me crazy for about a week now. (Please be nice even if it is a newbie question.)
Before I go into the issue, I want to give the following specifications about my system:
- AMD Athlon
- Redhat 7.1
- I think all ports are closed, except for the HTTP port (80, I think). If I remember correctly, that is the firewall specification for which I opted when I installed the operating system.
Now, for the problem itself. I want to learn socket programming in PHP. I have read about five tutorials so far, and I am very sure that I understand all the basics–what is a socket, how to open a live connection between two computers, etc.
But when I copy the source code in a tutorial, place it in a directory on the remote server that hosts my web site, and try to access the document by typing the URL of the document in the address bar, the document never loads.
Take this tutorial, for example. I copy out the first tutorial, save it as socket_testing.php, upload it to my web host, and then try to access it with my browser. No go, folks! Zilch! Not even when I relax the firewall settings.
I understand that the tutorial talks about saving the file on the local hard drive, but should it not work when the document is saved in any computer in which a server is running?
I know my question is very ill-formed, but I am hoping one of the gurus here can read my mind and help me out before I tear out my hair.
Thanks in advance for your help.