*> sudo visudo #find 'root ALL(...' and append this line below: www-data ALL=NOPASSWD:/usr/local/bin/myscript.sh #Save *> sudo cp myscript.sh /usr/local/bin/ *> sudo chmod 777 /usr/local/bin/myscript.sh #at php script: <?php $cmd = shell_exec("/usr/local/bin/myscript.sh params"); echo $cmd; ?>