參考網址:
https://chewett.co.uk/blog/258/vchi-initialization-failed-raspberry-pi-fixed/
If when running vcgencmd on a raspberry pi you get VCHI initialization failed then you need to add the video group to your user. The vcgencmd tool requires you have this group role so without it, it will give VCHI initialization failed.
To add the user group to your user you can run:
sudo usermod -aG video <username>
為了讓php可執行
sudo usermod -G video www-data