Webadmin and php
Bomb
Australia Join Date: 2003-02-20 Member: 13766Members, Constellation, Reinforced - Shadow
Hey anyone know how to get php support for the web admin client? Trying to do some enhancements (db integration etc) and it no worky.
Best guess is the server web admin has no php support which is a major bummer.
Any work arounds out there? Sorry I can't find any threads on this subject and I'm not that familiar with how an NS2 server passes the info to the web client.
There's a lack of doco information on how this all hangs together (or at least that I can find).
P.S hope this is actually a limitation and I'm not just missing something.
Best guess is the server web admin has no php support which is a major bummer.
Any work arounds out there? Sorry I can't find any threads on this subject and I'm not that familiar with how an NS2 server passes the info to the web client.
There's a lack of doco information on how this all hangs together (or at least that I can find).
P.S hope this is actually a limitation and I'm not just missing something.
Comments
Ran the webadmin though Apache and php scripts are executed. Still leaves the problem though as I can't run two web servers on the same port.
As for the webadmin ports, the current workaround is to use the -webport launch parameter to have the additional webadmins run on different ports if they are using the same IP (e.g. Server 1 webadmin = port 80, Server 2 webadmin = port 81, etc).
I can host the webadmin interface though Apache just fine, and php works. The problem is server.exe has to start it's own webserver or the web interface wont connect to the game server. Therefore using a webserver other then then dev's in built one wont work as you cant host two webservers on the same port. At least that is the assumptions I've come to given what I've tried out today.
Thanks for pointing in the right direction though, I'll message devicenull and see if he's not too busy to give this a once over.
Cheers.
Even if you could, You probably wouldn't want to since a web request is still a blocking operation. That means no ticks in game until the request finishes. I know that the fix for that is on max's to do list but i don't know when the server will become threaded separately.
If you want to run a php script, your best option is to do a REST JSONP service on apache. Then integrate the two on the front end in javascript. It keeps your server tick rate up and lets you run php in webadmin.
Easiest solution is to just proxy all the requests to the game server via your web server. This is pretty simple do to with most web servers, or it's a couple lines of PHP.