this question was emailed to me, so i thought i'd answer it in the php forum where it should be:
Quote:
hi its about web panel, i write similar panel on php and i need know mby you know how you starting hlds server through httpd?
i try any funcions system (); exec (); etc...
but that funcions didnt work....
in my config of php have acess on that funcions.
i try write system ("/etc/init.d/hlds start"); but it didnt work because no have root acess 
mby you know how through httpd starting my hlds ?
|
I would make a script that starts the half-life server and store it in a subdirectory of my user account.
/user/sde/scripts/start-hlds.sh
Code:
#!/bin/sh
./hlds_run -game cstrike +noipx +ip 1.2.3.4 +port
27015 +map de_dust2 +maxplayers 21 +localinfo
now if i want PHP to be able to modify this script, i need to change the permissions so everyone can execute it.
Code:
chmod 755 /user/sde/scripts/start-hlds.sh
now the script is setup and has permissions so anyone can read or execute it. let's use the php exec() function to now execute this script:
PHP Code:
<?
exec("/user/sde/scripts/start-hlds.sh");
?>
let me know how it goes.