<?php
$ret = exec('START C:\Program Files (x86)\Notepad++\Notepad++.exe', $output, $error);
// Debug
var_dump($ret);
var_dump($output);
var_dump($error);
?>
Update
maybe your php hasn't permissions to run commands on your wamp: https://stackoverflow.com/a/9161752/1721486
Answer from spinsch on Stack Overflow<?php
$ret = exec('START C:\Program Files (x86)\Notepad++\Notepad++.exe', $output, $error);
// Debug
var_dump($ret);
var_dump($output);
var_dump($error);
?>
Update
maybe your php hasn't permissions to run commands on your wamp: https://stackoverflow.com/a/9161752/1721486
on a mac, you'd need the command to actually open the app, like:
exec( 'open SomeApp.app' );
I think on Windows you would use 'start' (?)
exec( 'start notepad++.exe' );
Videos
Give the full path to the PHP executable and the full path to the PHP script. You can save the output in $output to see what the script produced:
exec("d:/path/to/php.exe d:/wamp/www/diplomski/program/defender/tester.php", $output);
print_r($output);
1) What version of php? If it is older then 5.4.0 php can be in safe mode, when safe mode is enabled, you can only execute files within the safe_mode_exec_dir.
2)Note to this function in php.net Note:
If a program is started with this function, in order for it to continue running in the background, the output of the program must be redirected to a file or another output stream. Failing to do so will cause PHP to hang until the execution of the program ends.
3) So you can try this How to make php script run another php script you can try this
<?php
$somearg = escapeshellarg('blah');
exec("php file2.php $somearg > /dev/null &");
4) You can create a scheduled task How to run a PHP file in a scheduled task (Windows Task Scheduler)