Question

I want to execute some command using php, like exec() function or system() function.

But the default cmd.exe was denied. There is another cmd.exe in 'E:\web\', I want to execute command using 'E:\web\cmd.exe',what should I use exec() function or system() function?

Was it helpful?

Solution

I guess it's “php.exe” that you should use.

LIKE:

  1. open windows console

  2. XXX> /PATH_TO_YOUR_PHP_BIN/php /PATH_TO_YOUR_SCRIPT_FILE/somescript.php

you can set your PHP_BIN_PATH as environment variable for convenience,

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top