I uploaded a windows program (.exe) to my windows server. I now need to execute it and pass through a parameter using PHP.. how would i do this? On my computer i would just do this throught the command line, so i not sure how to go about this with PHP.. sorry if this doesnt make a whole lot of sense.. NOOB here..

here is the command i would enter on my machine to run it through the command line.

SCOT.exe -f "C:/GSdata/Scotbatchfile.tsv"

and ideas?


8 Years
Discussion Span
Last Post by danimal132

You will need to compile or allow the option to execute on the server with in php.

Check to see if php allow the exec command.

function exec_enabled() {
  $disabled = explode(', ', ini_get('disable_functions'));
  return !in_array('exec', $disabled);

You will need to add executable permissions to the file.

You can then:


Hope that helps, its not really a very safe thing to have enabled, do not allow users to pass directly to this command.

For more info check the php man pages.


so will that function above enable php to execute on the server? sorry about this.. so will all i need to do is run that function to allow the php to execute the fuction?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.