PHP Sockets or Python, Perl, Bash Sockets? -


I am trying to implement a socket server that will run in most shared hosting hosting.

Requirements that the user can install the socket server without doing anything, can start and stop automatically from PHP, no matter what language the socket server It has been written, as long as it will run on the majority of shared hosting globally

Currently, I have written a socket server with PHP, which implements the object cache:

Source:

However, PHP Be compiled with Sockets support, and do not go with many servers PHP sockets support.

My real question is: what language should I apply to the socket server, and should be accessible from maximum platform support and inside PHP.

In other words, what is the most scripting language on a PHP enabled server?

Do I have to write the socket server in a compiled language to work on all servers?

IIS is currently excluded from the picture, just Linux server I do not think many PHP sites are running on IIS ...


Edit: < / P>

Sorry I guess my question is not clear.

I want to know which language is most appropriate for creating socket servers, following the following requirements:

Language with PHP running in Apache should be present in shared hosting (Not CLI) support of sockets should be enabled by default, not through the required extension. PHP should be able to start and stop the daemon as well as writing deamon.

I'm not asking for a single server solution to run it basically on the majority of shared hosting servers

It depends on the installed requirements. Often the easiest and most standard way of writing a socket server is to write one. This is a standard daemon on my Unix machines, and it will fork a process and handle socket level details. If you want your service to run on Unix on a port below 1024, then this is one of the easiest ways to do it. However, the initial installation requires the root to configure inet.d.

If you allow shared hosting, then allow PHP to exec exec, so you can start the daemon in this way. However, keep in mind, it will need to run above port 1024. You need to decide next whether your program is going multi-threaded or multi-process. Generally Java programs are multi-threaded, while Apache's example is usually multi-process.

Finally, the host may have a firewall in place. This helps prevent shared hosting accounts from being part of the boat-net if the firewall rules do not allow connections of other ports, you will not be able to connect it remotely.


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -