Do you have php-sqlite3 installed?
sudo apt install php-sqlite3
Do you have php-sqlite3 installed?
sudo apt install php-sqlite3
PHP Notice: Use of undefined constant SQLITE3_OPEN_READWRITE - assumed 'SQLITE3_OPEN_READWRITE' in /var/www/html/admin/scripts/pi-hole/php/groups.php on line 24, referer: https://dns.XX.xyz/groups.php
[Wed May 13 11:41:00.476481 2020] [:error] [pid 1747] [client 51.36.62.XX:25594] PHP Fatal error: Class 'SQLite3' not found in /var/www/html/admin/scripts/pi-hole/php/database.php on line 42, referer: https://dns.XX.xyz/groups.php
I install it and npw with new error logs
Restart lighthttpd
systemctl restart lighttpd.service
I know.. but I thought that were logs of /var/log/lighttpd/error.log
and apache was installed additionally
Then restart apache
I restart apache2 but same
for some reason . apache2 is running with diffent group not www-data ..but I already add pihole user to that apache group..Will that cause this error??I dont have any errors when changing setting on settings panel.only in groups/blacklist/whitelist panel
My last idea is
Your apache-user must be part in the pihole group, not vice-versa.
To check for the apache user
apachectl -S
ps aux | egrep '(apache|httpd)'
Otherwise some else (with apache knowledge) has to dig further.
Good luck.
I dont have an issue before this upgrade , I just assign pihole user to my apache group before..anyway the first error where missing php5.6 sqlite3 since im using php5.6,,so I install sqlite3 package..but know the error is this
Error, something went wrong!
While executing: attempt to write a readonly database
Added 0 out of 1 groups
Permissions may now be broken on the database. Try renaming or removing /etc/pihole/gravity.db
and allowing pi-hole to create a new one with pihole -g
Thanks I solve this problem with :
chown u+w gravity.db
chown g+w gravity.db
Or that!
well after updating gravity.db ,, there's error again, I recheck it and it was back to pihole owner and group..so I chmod it again to my apache group..
Hmm OK, sorry I can't be much more help in this situation. I've never used apache before.
I have seen a couple of apache issues fixed by installing php-sqlite3
, but don't take my word for that as I have no way to verify it other than anecdotal evidence.
Perhaps a community member would like to put together a guide for running Pi-hole behind Apache and submit it to our docs repo...
a simple solution is to add apache user to pihole group..as mention previously by yubiuser..and installing php5.6 sqlite3 if they have php 5.6 version..
I also use apache and had the same problems. For me apt update && apt install php-sqlite3
and usermod -aG pihole www-data
helped, then a restart of Apache.
I would really love to see this happen! Would help the community in the long-run.
I'd like to note that running Pi-hole with Apache2, PHP7.2 - this worked first time for me. Thanks!
this solved it for me, too. don't forget to check apache error logs. they may contain the actual cause of the problem and therefore the key to its solution.
This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.