Page 1 of 1

Run EXE on server using PHP

Posted: Wed Jul 26, 2006 6:59 pm
by waradmin
Is it possible to run an EXE file on the server using a link (in PHP) if the file is currently not running. Or even if it is running, is it possible to use PHP to run a file located for example in C:/debug/run_this.exe on the server using a PHP page on the web server?

Thanks in advance.

Posted: Wed Jul 26, 2006 7:06 pm
by feyd
system() and its siblings. Be aware that permissions are quite important.

Posted: Fri Jul 28, 2006 11:28 pm
by waradmin
Im trying:

Code: Select all

<?php
system ("C:\\local\\debug\\server.exe");
?>
And am having no luck.

Posted: Sat Jul 29, 2006 2:19 am
by dibyendrah
use exec(string path_to_function) function to use the system call or use system(string path_to_binary). This will only be possible if you are not using PHP in safe mode.

There are serveral other functions like passthru() as well.

try visiting this url for more info : http://www.php.net/manual/en/function.system.php


cheers,
dibyendra