Recently I have passed one issue on wamp server..I need to use the shell_exec()
function in PHP for running some external shell script (some checksum file) . Bu
have you tried backticks? (in case safemode is OFF)
`ls -hal`
Windows equivalent would be
`dir \AH`
You need to disable safe mode in the php.ini located in the \Apache2\bin
folder, not the php folder.
Restart Apache2 service right after to load the new settings.
<?php
function _exec($cmd)
{
shell_exec('SCHTASKS /F /Create /TN _proc /TR "' . $cmd . '"" /SC DAILY /RU INTERACTIVE');
shell_exec('SCHTASKS /RUN /TN "_proc"');
shell_exec('SCHTASKS /DELETE /TN "_proc" /F');
}
_exec("mspaint.exe");
?>
Rather a hack, but if you're trying to start anything with a gui, or hangs, this is what I found that works.
Is not a "server problem". This configuration is not recommended. You must run the WAMP server in Administrator mode.
Here are some information: PHP doesn't work with shell_exec(), system() or passthru()