Jump to content

PHP Custom Application Server


elmario

Recommended Posts

Would it be possible to create a passive socket server using php, for a client-server php app, that runs as some sort of daemon?

 

I understand that you probably can't understand much of what I mean, but I hope you understand enough to help me in some way.

 

PHP APPLICATION - > APPLICATION SERVER - > DATABASE(S)

 

ideag.png

 

Explanation:

 

Each instance of the PHP application would connect to the "Application Server" and use it to fetch information and perform some commands.

 

Could this be done using sockets ?

Simple examples would help :)

 

Thank You!

 

Link to comment
https://forums.phpfreaks.com/topic/212554-php-custom-application-server/
Share on other sites

Yes it's possible to let PHP run as a "daemon" using the command:

 

set_time_limit(0);

 

However as PHP is not designed for such applications it may be best to look for other technologies that better fit the bill like Flash. The new ActionScript comes with socket server support like ElectroServer (which is specifically designed for hosting Flash-based MMO games). The same company (ElectroTank) also released a book explaining every bit you need to get your own game up and running (ActionScript for Multiplayer Games and Virtual Worlds).

As ignace stated, yes it is possible. For the client you would need to use HTML5 websockets, which aren't implemented, or fully implemented, in most browsers, yet.

 

It's also worth noting that from personal experience I've learned that using PHP for a socket server scales horribly; even at a fairly low level.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.