Thanks, but my hole pihole.log looks like this
That's why I think it's a problem with the gravity.list
Thanks, but my hole pihole.log looks like this
That's why I think it's a problem with the gravity.list
I fixed the problem by setting the permissions of /etc/pihole to 777 and than made pihole -up again
nginx is not a supported server for the Pi-hole web admin page. There is an unsupported user guide that may have some information that can help you:
I'm experiencing the same issue. Also, FTL won't update from 4.3.1 to 5:
E: Unable to locate package php5-xml
E: Unable to locate package php-intl
I already setup correctly by this guide
I have the same problem.
And also errors on the GroupManagement-Groups page, Network page and others because Ajax content cannot be loaded. Does that work for you?
http://192.168.1.2/admin/api_db.php?network&_=1589217731596 -> Error 500
http://192.168.1.2/admin/scripts/pi-hole/php/groups.php -> "Not allowed (login session invalid or expired, please relogin on the Pi-hole dashboard)!"
Yep I agree
Hi guys, everyone who did not choose to install Lighttpd within Pi-hole installer needs to do:
usermod -aG pihole www-data
apt install php-intl # Respectively the package matching your PHP version, like php7.3-intl
I just got the idea to view the error log from the webserver:
[Mon May 11 20:33:50.704422 2020] [php7:warn] [pid 3039] [client 192.168.1.60:56525] PHP Warning: Use of undefined constant SQLITE3_OPEN_READONLY - assumed 'SQLITE3_OPEN_READONLY' (this will throw an Error in a future version of PHP) in /var/www/html/admin/scripts/pi-hole/php/database.php on line 61, referer: http://192.168.1.2/admin/network.php
[Mon May 11 20:33:50.704669 2020] [php7:error] [pid 3039] [client 192.168.1.60:56525] PHP Fatal error: Uncaught Error: Class 'SQLite3' not found in /var/www/html/admin/scripts/pi-hole/php/database.php:42\nStack trace:\n#0 /var/www/html/admin/scripts/pi-hole/php/database.php(65): SQLite3_connect_try('/etc/pihole/pih...', 'SQLITE3_OPEN_RE...', true)\n#1 /var/www/html/admin/api_db.php(56): SQLite3_connect('/etc/pihole/pih...')\n#2 {main}\n thrown in /var/www/html/admin/scripts/pi-hole/php/database.php on line 42, referer: http://192.168.1.2/admin/network.php
Then I checked if php-sqlite3 is installed, which was not the case. After a webserver restart it worked again.
Edit:
New problem: When I want to edit the groups While executing: **attempt to write a readonly database**
Please open a new topic for this problem, so the existing topic for the original issue can continue.
The issues have the same source, hence I would not separate. In case of OP it is expected since Nginx as webserver means that INSTALL_WEB_SERVER=false is set which again means that the installer/updater does not add www-data to pihole group, preventing database write access, and no PHP modules are installed, leading to missing SQLite and intl modules. Although in case of SQLite it is strange since this was used/required before already .
Micah, respectfully, we'll handle our support the way we prefer.
I have tried but no change in view and errors by loading the query log or group management.
I already installed sqlite for php7.x in the past.
Nginx is running as www-data
, right? Could you paste the output of:
ls -Al /etc/pihole
Thank you jbf for your replay. I just did usermod -aG pihole www-data
restarted my webserver and now settings can be saved.
Thank you MichaIng for pointing that out.
Here it is...
root@PanicatTheCisco:~# groups www-data
www-data : www-data pihole
root@PanicatTheCisco:~# ls -Al /etc/pihole
insgesamt 8108
-rw-r--r-- 1 root root 242 Mai 11 13:01 adlists.list
-rwxrwxrwx 1 pihole pihole 242 Mai 11 10:17 adlists.list.old
-rwxrwxrwx 1 pihole pihole 0 Mai 12 06:47 dhcp.leases
-rw-r--r-- 1 pihole pihole 596 Mai 11 13:01 dns-servers.conf
-rw-r--r-- 1 pihole pihole 14 Mai 12 06:48 GitHubVersions
-rw-rw-r-- 1 pihole pihole 5087232 Mai 11 13:02 gravity.db
-rw-r--r-- 1 pihole pihole 1051 Mai 11 13:01 install.log
-rw-r--r-- 1 root root 1100893 Mai 11 13:01 list.0.raw.githubusercontent.com.domains
-rw-r--r-- 1 root root 594672 Mai 11 13:01 list.1.mirror1.malwaredomains.com.domains
-rw-r--r-- 1 root root 521 Mai 11 13:01 list.2.s3.amazonaws.com.domains
-rw-r--r-- 1 root root 43529 Mai 11 13:01 list.3.s3.amazonaws.com.domains
-rw-r--r-- 1 pihole pihole 20 Mai 12 06:50 localbranches
-rw-r--r-- 1 pihole pihole 160 Mai 11 13:02 local.list
-rw-r--r-- 1 pihole pihole 36 Mai 12 06:50 localversions
-rw-r--r-- 1 root root 234 Mai 11 13:01 logrotate
drwxrwxrwx 2 pihole pihole 4096 Mai 11 10:38 migration_backup
-rwxrwxrwx 1 pihole pihole 15 Mai 11 13:01 pihole-FTL.conf
-rwxrwxrwx 1 pihole pihole 1409024 Mai 12 06:53 pihole-FTL.db
-rw-r--r-- 1 pihole pihole 448 Mai 11 13:01 setupVars.conf
-rwxrwxrwx 1 pihole pihole 448 Mai 11 13:01 setupVars.conf.update.bak
Okay, permissions for gravity.db
are definitely there and correct.
I just reviewed the Nginx config from docs: Redirecting...
I am not sure whether the basic authentication part could cause problems. Not sure why it is there since the admin panel itself has an included authentication already, so this looks doubled to me? Just to try to comment all lines starting with auth_basic
/auth_basic_user_file
in your Nginx config, then restart it (systemctl restart nginx
) and check if it works. If it still does not, of course revert to re-enable authentication.
I think my config are right, with auth and without auth it doesn't work i tried everything
server {
listen 80;
listen [::]:80;
root /var/www/html;
server_name panicatthecisco;
autoindex off;
index pihole/index.php index.php index.php index.html index.htm;
location / {
add_header Strict-Transport-Security max-age=15768000;
index index.htm index.html index.php index.nginx-debian.html;
expires max;
try_files $uri $uri/ =404;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
fastcgi_param FQDN true;
#auth_basic "Restricted"; #For Basic Auth
#auth_basic_user_file /etc/nginx/.htpasswd; #For Basic Auth
}
location /admin {
root /var/www/html;
index index.php index.html index.htm;
#auth_basic "Restricted"; # For Basic Auth
#auth_basic_user_file /etc/nginx/.htpasswd; # For Basic Auth
}
location /*.js {
index index.js;
#auth_basic "Restricted"; #For Basic Auth
#auth_basic_user_file /etc/nginx/.htpasswd; #For Basic Auth
}
location ~ /\.ht {
deny all;
}
}
PHP7.0 is correct, right? Are there any errors in webserver and/or PHP logs:
journalctl -u nginx
journalctl -u php7.0-fpm
tail -20 /var/log/nginx/error.log # Exact path/file might differ
tail -20 /var/log/php7.0-fpm.log # Exact path/file might differ