Hmm...
Replace
Code:
$shellscript = “/usr/bin/sudo autopasswd”;
With
Code:
$shellscript = “/usr/bin/sudo /var/www/html/autopasswd”;
Also when you run a php script just look at apahce error and access log using tail -f command - you will get error message
Code:
tail -f access.log
tail -f error.log