I'm running the webserver lighttpd on Raspbian (Debian based) on a Raspberry Pi. The server runs as user www-data (checked with
ps aux). I added the following line to
to be able to run the
vcgencmd tool from the Raspberry Pi that gives status information from within a PHP file with
<? echo shell_exec('vcgencmd version'); ?>
All it prints is "VCHI initialization failed" (instead of the supposed version information that appears when I run it on my user even without
sudo) which appears when vcgencmd is run with wrong permissions.
Running for example
<? echo shell_exec('cat /sys/class/thermal/thermal_zone*/temp'); ?>
works fine without any
/etc/sudoers change, so there's no problem with PHP (like forbidden
shell_exec or something).
What else needs to be set in order to execute a command?