   PHP Game Server?
  Hello all,I would like to know if building a game server in php and use it from a free php web host is a good idea (if possible at all). It would be nice to make a game that is hosted in another computer so you don't have to keep yours up 24/7, and i don't think there are hosts that are willing to run a windows based server.   
  The free web hosts have really nasty limitations on bandwidth, CPU and database usage. If your game becomes popular at all, your site will become disabled, or you'll be sent a bill to pay.In general, if your game is turn based, and doesn't need interactivity (such as text chat between players), then writing the server in typical PHP-in-Apache is probably just fine. Let's assume you use 50 milliseconds of CPU time for a "turn," and each player takes a turn every 20 seconds on average, that gives you 400 players before you saturate a single server.If you need interaction, and/or "bouncing" data quicker between players, then PHP-in-Apache is probably not what you want.;Quote:so you don't have to keep yours up 24/7As someone who made an open source ORPG engine, I hear this a LOT. People always ask if it is possible to run it on a free host, or on their website host's server. A lot of cheaper website hosts will disable a lot of features that can be used in processing-intensive or bandwidth-intensive ways. Even if the features are enabled, they do monitor who is using the most resources (CPU, disk I/O, disk space, database size, etc) and will cut you off without refund (and sometimes with a fee). So make sure that you ask your host if it is alright first.If you have a legitimate reason for not being able to host a server 24/7, but need 24/7 hosting, I recommend either changing whatever is stopping you from hosting it yourself or find someone who will host your game for you for the time being. If people see a game they feel has potential, there will be a lot of people willing to host the server for you. When you need more power, you can move to a VPS, which can be anywhere from $15-$60+ a month (depending on what you get and from where).But just remember, there is no reason something needs to be publicly accessible before it is ready to be publicly accessible. In other words, don't worry about having a 24/7 server host until your game is even complete enough for people to play.   ;  Also note that with a dedicated "root" server, or a virtual private server (fractional server a la VMWare, Xen, etc), or even with Amazon Elastic Compute Cloud, you can usually host Windows apps just fine (although often at an upcharge).One of the lower-cost options is a 150 MB VPS from DreamHost, which is $15/month for the VPS plus $10/month for the separate unlimited webhosting that's also required to be a customer. If you use discount code L33TN3SS, you get $50 off your first year and a bonus free domain registration. This is where I host my sites EncahntedAge.com and kwxport.org (both from the same account), and I've been happy with them for several years.If you step up to the Amazon option, your minimum cost is $72/month for Linux, or $90/month for Windows, plus bandwidth. (Most other hosts do not charge for bandwidth, at least up to some generous limit)If you step up even more to a self-managed "root" server, such as from ServerBeach.com, you start at $69/month, but probably want a machine around $139/month quad-cores for that option to make sense compared to Amazon or the virtual hosts.And Spodi is very, very right: Before you actually have a working game that you want people to play 24/7, you don't need to have any 24/7 hardware available.Finally, it's been my experience that you should go with people who have been around for a long time, and who have good customer service and good referrals from other customers. Once you're with a hosting company, moving to somewhere else is both expensive, labor intensive, and disruptive to your users. The options I suggested are all in that category AFAICT, while remaining fairly price competetive as well (no sense paying more than you have to).   