Starting a program using system() (or whatever)

habl

Verified User
Joined
Sep 7, 2009
Messages
6
Hi all.

I am busy with writing a control panel for a game and therfor it's needed to start and stop the game using some shell function in PHP. Only the problem is the games are placed in user home directory's. Since directadmin doesn't allow to read other home directory's, also apache can't do anything there. I changed the folder access to 777 and made apache group owner, try to start the game from the shell with another user. No errors appears now, but just nothing happends. Entering the same command as the owner of the home directory or as root, starts the game well.

Is there any way to allow apache to start applications within another userdirectory's?

Btw, didn't know for sure in wich board this topic belongs, but since I experienced the problem in PHP I guessed this one =)

Edit: Oh, i'm running directadmin on debian lenny (32bit) btw
 
Last edited:
And if 777 did work you'd have a very easy to compromise server. So I won't tell you how to do that, though you should be able to find the information on these forums.

DirectAdmin does it by actually changing to the necessary user, but it's written in C++, and it's tested to be secure. I wouldn't recommend you do that in software written in PHP unless you know how to run a wrapper program as root.

It's probably an off-topic thread. I'll leave it in the MySQL/PHP forum for now.

Jeff
 
I understand it's much safer this way, but it restrict me a bit in freedom ;)
Aren't there any other suggestions on how to make it possible to start the game using php?
 
There are many game control panels already designed that you can purchase.
 
Yes there probably are, but for gta sa:mp there aren't very good panels available, so that's why I'm trying to make my own. Wich is a bit harder then I tought. I expected it to be possible to start a game from a script.
 
Prob have better luck asking on a php scripting forum. I doubt anything directadmin is getting in the way. Most apache things setup in directadmin is standard.

Maybe try using sudo to issue commands. I find it the best way to run commands when I am wanting to run commands.
 
Back
Top