Please follow the below template, it will help us to help you!
If you are Experiencing issues with a Pi-hole install that has non-standard elements (e.g you are using nginx instead of lighttpd, or there is some other aspect of your install that is customised) - please use the Community Help category.
Expected Behaviour:
[Pihole should be showing its status as active as everything is working correctly.
OS Dietpi/bullsye]
2022-01-12 20:22:28: mod_fastcgi.c.487) FastCGI-stderr:PHP message: PHP Warning: Executing sudo pihole status web failed. in /var/www/html/admin/scripts/pi-hole/php/func.php on line 15
2022-01-12 20:18:05: mod_fastcgi.c.487) FastCGI-stderr:PHP message: PHP Warning: Executing sudo pihole restartdns reload-lists failed. in /var/www/html/admin/scripts/pi-hole/php/func.php on line 15
Something is wrong here. The web interface failed to execute Pi-hole commands. Strangely, the relevant line of code is not at line 15.
2022-01-13 16:34:11: mod_fastcgi.c.487) FastCGI-stderr:PHP message: PHP Warning: Executing sudo pihole status web failed. in /var/www/html/admin/scripts/pi-hole/php/func.php on line 15
2022-01-13 16:34:11: mod_fastcgi.c.487) FastCGI-stderr:PHP message: PHP Warning: Executing sudo pihole status web failed. in /var/www/html/admin/scripts/pi-hole/php/func.php on line 15
Could it be an issue with permissions? I tried installing pihole via the curl method and also through the dietpi-software suite but either way still shows offline. I'm running pihole, unbound and pivpn together and it's working great
hi,
I had the same problem, and after lots of trial and error I found it was due to subtle syntax errors in the sudo setup , specifically missing spaces -
# **cat /etc/sudoers.d/pihole**
# Pi-hole: A black hole for Internet advertisements
# incorrect syntax here caused pihole admin pages to show Status=Offline , 14jan2022 robin
#www-data ALL=NOPASSWD: /usr/local/bin/pihole
www-data ALL = NOPASSWD : /usr/local/bin/pihole
After adding the missing spaces between ALL and = and NOPASSWD and the colon , the Pihole web status started showing 'Active' , and I no longer see 'PHP Warning: Executing sudo pihole version failed.' errors in the lighttpd error log
These spaces were never (and are not on all systems of all Debian versions I run and test) required.
EDIT: Also the official man page does not suggest a space after NOPASSWD: sudoers(5) — sudo — Debian bookworm — Debian Manpages
The SUID bit is indeed missing, that way sudo cannot work at all. Not sure how this can happen (it is natively shipped with the package, of course, and since we saw reports about this several years ago for fresh Raspbian images, the DietPi image script sets it as well), but here is how to resolve: