[Challenge] How good is a PHP server for games


I have a big problem.

I have a pretty limited server / host (I can only use WordPressJoomla, JoomlaDrupal, DrupalMyBB, MyBBPrestaShop, PrestaShopphpBB, **phpBB **and MYSQL).
I’m not 100% owner either, but I can execute what I mentioned.

I understand that to run an application with Unreal engine you need a CLOUD, for example AWS, Google Cloud, Microsoft Azure or others.

My question is based on the type of host I have:

1 - Can I create a server with PHP for a “multiplayer” game
I guess we are talking about a dedicated server
2 - Can I create a session between C ++ and PHP and have good performance?
3 - Will it work and the game / room of UE4 will play without any errors?
That is, without having to run UE4 on the server, why can’t I run C ++ or another language on the server. That is, have a room “id” and that ID keep or keep the game (as a persistence)

  • Even if the user logs out, the room remains “active”
  • Even if the user exits the game, the room remains “active”
    4 - And most importantly, how would the “replicate” act?

I am talking about a server with many limitations. Could I do something?

If I have the connections to the DB with PHP, what should I do with C ++ to connect them through a session ?, websocket ?, or is there another better system?

1 - Is it a good idea to have a PHP server instead of Python, Java or any other for a multiplayer game?

2 - Could I have a PHP server for a game with the UE4 engine?

Or it’s just not worth it.

I read:…webserver.php

This web server was designed to aid application development. It may also be useful for testing purposes or for application demonstrations that are run in controlled environments. It is not intended to be a full-featured web server. It should not be used on a public network.


Today is Monday, I guess EPIC GAMES employees in the US are already working.
Is there any way what I commented on?
I prefer to be told: we don’t know how to do it.
Instead of the post being unanswered like so many other posts I have from 2015 - 2020 unanswered.

hey, another noob here.
I have no idea about UE network components or read any UE multiplayer tutorials. I have some webdev experience.

Apart from what ungodly monkey hacks are required and the obvious “don’t do this”:

FPS? you did not mention what type of game…

Turn based games (slow traffic) most likely, but the overhead of a full fat web server introduces latency, so I would avoid it for FPS.
Biggest concern here is that you would be writing your own game server, full of mistakes and exploits…

If you have access to websockets, then thats quite nice.
In effect, you could skip your server logic running in the server. One of the ws clients could be the “server”.

  1. I would steer away from anything related to PHP, but to each their own.
  2. As said, simple game that uses simple HTTP post/get, and is basically fancy 3d rendered website browser, yeah, why not.

I used to hack around in a 2$/month ARM server from scaleaway (discontinued),
I would search for a similarly cheap server where you can install whatever you want or use it as a webtraffic proxy.

hopefully, I did not add to the confusion.

Buddy check this.…stand-anything

Do you have any specific questions about my answer?

What type of game are you planning?

I will try to do my best to resolve this misunderstanding if you want to move forward.

also, answered the thread you started : )

The problem arises that I need information about a native server in PHP.

I understand the need to help and it is appreciated. But the problem is, who is going to be better prepared to answer these types of questions? Then, it is preferable that a C ++ programmer from the UE4 house answers, why? Because they know its design and its limitations. It is understood that they are the ones who at least can say “hey, this is a bad idea”.

If the vast majority of messages are to try to help by saying “I’m a newbie” and I’ve done this, it doesn’t help the problem. Thanks anyway, but it doesn’t solve the problem.

I need some pretty sensitive information.

It may seem like a simple question, but in this simple question, it is arguing about a “native server” and how UE4 could interact, both in speed, resources, overhead, stackoverflow, stack errors and many others.

It is better to have your own Unreal Engine C ++ employee answer according to your experience on the problem of having a native server. I know “Replication”, but to what extent can a native server be done regardless of language?

**vegetablejuiceftw **Thanks anyway and excuse my rudeness on this forum.

Its bad, and will never work well for any game larger than single player. Basically php is scripted single threaded language, meaning it will launch script, execute and die on every request. Second - php is slow by its nature(not just php, but also python, ruby, etc) so even in very well optimized environment and well written scripts you will never achieve good response rate for your multiplayer game. Also you should understand - there are 2 parts of networking:

First - replication, which is really difficult part and most reasonable way to do this - use UE’s dedicated server which you can build separately from game, and which will serve as your replication(world server). While replicating stuff, you also can do some calculations on server and stand as authority for players, can force client to run any actions you need(google for UE4 Remote procedure call), calculate hit points, do tracing(if you have FPS and have some shooting mechanics)

Second - game server(or you can call it game rules server). This server responsible for any actions that may hurt other player’s gameplay. For ex. you wont allow players to change in memory values to give them 10 potion instead of 1 and, you dont want them to remove cooldowns off these potions to have constant 100% HP. Also this server responsible for any interactions with database, such as item crafting(you want to persist amount of crafted items in database, to be able get it next time user logs in to the game) or any other things you might want to persist for latter usages.

This is some basics for online games. Besides these 2 types of servers you might have some cache servers or in memory storages like redis or memcached to store values that uses more often than others.

As for your questions - you can use your php scripts for anything that does not relates directly to game play mechanics, so having session/room management is totally fine(some big names actually uses php/python for their login/update servers). Basically it will work as a web api server, so any framework like symphony or any other will work well. You dont need any special protocol for this, since there are plugins for UE to do web requests(VaRest plugin) using json format and get responses with player details(id, name, etc) and having UE to use these values later. You also can use your php server as scoreboard. Basically anything that does not require instant response(<30-40 ms) will work just fine.

If you have more specific question - let me know and I will try to answer that