If you use PHP in safe mode, then only files in safe_mode_exec_dir will be allowed.
You seem to be working in a Windows environment. You might want to consider doing this using the Windows shell, which gives you more control over your external executing programs and can return additional information if it doesn't work, and help diagnose that the main problem is related to the exec () function.
Comments on the PHP online manual:
Run Notepad.exe in the background with a minimum value:
<?php $WshShell = new COM("WScript.Shell"); $oExec = $WshShell->Run("notepad.exe", 7, false); ?>
run a shell command invisible in the background:
<?php $WshShell = new COM("WScript.Shell"); $oExec = $WshShell->Run("cmd /C dir /S %windir%", 0, false); ?>
start up MSPaint and wait until you close it before continuing with the script:
<?php $WshShell = new COM("WScript.Shell"); $oExec = $WshShell->Run("mspaint.exe", 3, true); ?>
For more information about the Run () method, go to: https://msdn.microsoft.com/en-us/subscriptions/d5fk67ky(v=vs.84).aspx
Ryanerd
source share