I am trying to run adb from PHP using:
exec( 'adb devices', $output, $return_val );
but I get 126 error.
I think the problem is that php is running as 'www-data' user and does not have permissions to execute adb.
Allow the www-data user to run to run adb and abd with no password:
Add to the contents of the sudoers file: