Hello everyone, I have a Counter-Strike 1.6 server and I would like to let my server admins to turn ON the server when it crashes, so I investigated a bit to do this using PHP to run an .exe on my server but I'm not very experienced at php and I couldn't figure out how to do this and it's giving me a very big headache cuz I can't find any website/forum that explains how to run a .exe with php.. I have a dedicated server, with Windows server 2003 sp1 .. this is the path to the .exe I want to execute with PHP it's a shortcut, and this is the target: I would appreciate if someone could tell me the PHP code to run this application through PHP.. Thanks !!
Place schlds.exe in your public_html folder. Or a folder you know the path to (preferebly the same folder as the .php file), and try to execute from there.
nope, doesn't seems to be working.. i placed the exe at the same location as the PHP file and nothing..
I tried: <?php exec("C:\\xampp\\htdocs\\test\\schlds.exe"); ?> Code (php): and: <?php exec("schlds.exe"); ?> Code (php): and <?php exec("./schlds.exe"); ?> Code (php):
<?php if (exec("schlds.exe") || exec("/schlds.exe") || exec("./schlds.exe")){ die('true'); } echo 'false'; ?> PHP: Tell me what happens.
ugh. I suggest telling your friends to download PuTTY. Give them SSH access, and teach them how to execute the program from there. I'm not very experienced with exec.
It is a console.. The .exe I want to run is a shortcut with the following path: "C:\HLDS\hlds.exe" -console -game cstrike -ip MYIPHERE -port 27016 +maxplayers 27 +map de_nuke Code (php): is there any way to get this command working??
are you doing it like this? $exe = "C:\HLDS\hlds.exe -console -game cstrike -ip MYIPHERE -port 27016 +maxplayers 27 +map de_nuke"; exec($exe, $result); print_r($result); PHP:
yes, this is what I'm doing: <?php $exe = "C:\\HLDS\\hlds.exe -console -game cstrike -ip HERETHEIP -port 27017 +maxplayers 12 +map de_dust"; exec($exe, $result); print_r($result); ?> Code (php): and all i get is Array ( )