# Webmin doesn't save

**URL:** <https://discourse.pi-hole.net/t/webmin-doesnt-save/6209>\
**Category:** Help\
**Created:** [December 28, 2017, 5:03pm UTC](https://discourse.pi-hole.net/t/webmin-doesnt-save/6209 "2017-12-28T17:03:58Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![driz](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/driz/32/2405_2.png) [@driz](https://discourse.pi-hole.net/u/driz)\
**Post date:** [December 28, 2017, 5:03pm UTC](https://discourse.pi-hole.net/t/webmin-doesnt-save/6209/1 "2017-12-28T17:03:58Z")

</div>

#### Please follow the below template, it will help us to help you!

## Expected Behaviour:

Make a change on the web interface, have the change saved when i click save

## Actual Behaviour:

Make a change on the web interface, change doesnt save when I click save

## Debug Token:

ak634r9d27

[Settings not saved via web interface](https://discourse.pi-hole.net/t/settings-not-saved-via-web-interface/3219) has a very similar issue with slight differences.

System is CentOS 7.4, selinux is set to permissive

to add a little, my status also shows unknown. If i click enable, it will green up until i click or refresh, then it's unknown again. That said, everything is working, so this may be cosmetic.

---

<div class="post-metadata">

**Author:** ![DL6ER](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/dl6er/32/281_2.png) [@DL6ER](https://discourse.pi-hole.net/u/DL6ER)\
**Post date:** [December 28, 2017, 7:16pm UTC](https://discourse.pi-hole.net/t/webmin-doesnt-save/6209/2 "2017-12-28T19:16:20Z")

</div>

In your debug log I see some errors in your `/var/log/lighttpd/error.log` like:

```auto
   2017-12-28 10:59:00: (mod_fastcgi.c.434) FastCGI-stderr: PHP Fatal error: Can't use function return value in write context in /var/www/html/pihole/index.php on line 108
   2017-12-28 10:59:54: (mod_fastcgi.c.434) FastCGI-stderr: PHP Fatal error: Can't use function return value in write context in /var/www/html/pihole/index.php on line 108

```

do these coincidence with the times you tried to save something?

---

<div class="post-metadata">

**Author:** ![driz](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/driz/32/2405_2.png) [@driz](https://discourse.pi-hole.net/u/driz)\
**Post date:** [December 28, 2017, 7:23pm UTC](https://discourse.pi-hole.net/t/webmin-doesnt-save/6209/3 "2017-12-28T19:23:56Z")

</div>

> [@DL6ER](#):
>
> /var/log/lighttpd/error.log

They do not, here is how I checked  
I opened up a tail session on /var/log/lighttpd/error.log  
i logged into the webmin and made a dns change, i clicked save. I clicked refresh (noted that the change has not saved) and verified no log entries in my tail session during this time.

to add to this, here are the referenced lines

> ```
> // Determine if at least one block list has been generated
> if (empty(glob("/etc/pihole/list.0.*.domains")))
> die("[ERROR] There are no domain lists generated lists within <code>/etc/pihole/</code>! Please update gravity by running <code>pihole -g</code>, or repair Pi-hole using <code>pihole -r</code>.");
> 
> ```

> ls /etc/pihole/list.0.\*.domains  
> -rw-------. 1 root root 1276933 Dec 28 11:27 /etc/pihole/list.0.raw.githubusercontent.com.domains

---

<div class="post-metadata">

**Author:** ![DL6ER](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/dl6er/32/281_2.png) [@DL6ER](https://discourse.pi-hole.net/u/DL6ER)\
**Post date:** [December 28, 2017, 7:26pm UTC](https://discourse.pi-hole.net/t/webmin-doesnt-save/6209/4 "2017-12-28T19:26:46Z")

</div>

Okay, do you see anything in your SELinux logs? The webinterface in its current form is running small scripts in the background to save updates to the configuration, so if the webserver is not allowed to run the command `pihole` with arguments, saving the configuration will not work. We are working on an all-integrated API that can handle everything without having to rely on external scripts but that one is still very much in the works.

---

<div class="post-metadata">

**Author:** ![driz](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/driz/32/2405_2.png) [@driz](https://discourse.pi-hole.net/u/driz)\
**Post date:** [December 28, 2017, 7:32pm UTC](https://discourse.pi-hole.net/t/webmin-doesnt-save/6209/5 "2017-12-28T19:32:31Z")

</div>

I do have some items in selinux logs, but since i'm in permissive mode, it's just logging what would've been blocked (i havent set any constraints since im permissive, so i expect failures for pihole things), not taking any action. here are the relevant lines

> type=USER\_CMD msg=audit(1514489299.576:369): pid=8849 uid=992 auid=4294967295 ses=4294967295 subj=system\_u:system\_r:httpd\_t:s0 msg='cwd="/var/www/html/admin" cmd=7069686F6C652073746174757320776562 terminal=? res=failed'  
> type=USER\_CMD msg=audit(1514489299.580:370): pid=8850 uid=992 auid=4294967295 ses=4294967295 subj=system\_u:system\_r:httpd\_t:s0 msg='cwd="/var/www/html/admin" cmd=7069686F6C65202D61202D69206C6F63616C202D776562 terminal=? res=failed'  
> type=USER\_CMD msg=audit(1514489299.583:371): pid=8851 uid=992 auid=4294967295 ses=4294967295 subj=system\_u:system\_r:httpd\_t:s0 msg='cwd="/var/www/html/admin" cmd=7069686F6C65202D6120736574646E73203139322E3136382E3132382E33302C382E382E342E3420646F6D61696E2D6E656564656420626F6775732D70726976206E6F2D646E73736563 terminal=? res=failed'

---

<div class="post-metadata">

**Author:** ![Mcat12](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/mcat12/32/20_2.png) [@Mcat12](https://discourse.pi-hole.net/u/Mcat12)\
**Post date:** [December 28, 2017, 9:23pm UTC](https://discourse.pi-hole.net/t/webmin-doesnt-save/6209/6 "2017-12-28T21:23:15Z")

</div>

Is there a message at the top of the page after you try to save?

---

<div class="post-metadata">

**Author:** ![driz](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/driz/32/2405_2.png) [@driz](https://discourse.pi-hole.net/u/driz)\
**Post date:** [December 28, 2017, 9:53pm UTC](https://discourse.pi-hole.net/t/webmin-doesnt-save/6209/7 "2017-12-28T21:53:40Z")

</div>

yes, it just states

Info

The DNS settings have been updated (using 2 DNS servers)

but it doesnt

---

<div class="post-metadata">

**Author:** ![bcambl](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/bcambl/32/10212_2.png) [@bcambl](https://discourse.pi-hole.net/u/bcambl)\
**Post date:** [December 28, 2017, 10:06pm UTC](https://discourse.pi-hole.net/t/webmin-doesnt-save/6209/8 "2017-12-28T22:06:58Z")

</div>

I just performed a fresh install on CentOS7 and I was able to successfully add additional block lists and change my upstream DNS without issues.  
However, I do not get the same PHP errors as you..

- Is this a fresh install or an upgrade?
- have you reboot since the install?
- what DNS settings are you attempting to change?
- Your debug log states that you also have local changes in your web directory. What changes have you made?

---

<div class="post-metadata">

**Author:** ![driz](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/driz/32/2405_2.png) [@driz](https://discourse.pi-hole.net/u/driz)\
**Post date:** [December 28, 2017, 10:23pm UTC](https://discourse.pi-hole.net/t/webmin-doesnt-save/6209/9 "2017-12-28T22:23:47Z")

</div>

- Was an existing centos7 box running openvpn and dhcpd
- I have rebooted
- the DNS ip for server 2 (i changed it in the file, so i'm not stuck or anything)
- the only changes I made to the local web directory were chcon when i was going to leave selinux to enforcing

If it's not reproducible, it's not a big deal and we can close this. I just wanted to ensure I shared a potential bug 🙂

---

<div class="post-metadata">

**Author:** ![bcambl](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/bcambl/32/10212_2.png) [@bcambl](https://discourse.pi-hole.net/u/bcambl)\
**Post date:** [December 30, 2017, 6:02am UTC](https://discourse.pi-hole.net/t/webmin-doesnt-save/6209/10 "2017-12-30T06:02:28Z")

</div>

I was unable to reproduce this issue.  
Please try `pihole -r` with `reconfigure` option.

---

<div class="post-metadata">

**Author:** ![iefbr14](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/i/ebca7d/32.png) [@iefbr14](https://discourse.pi-hole.net/u/iefbr14)\
**Post date:** [January 2, 2018, 3:28am UTC](https://discourse.pi-hole.net/t/webmin-doesnt-save/6209/11 "2018-01-02T03:28:00Z")

</div>

i am getting the same error on a fresh install of pihole. attempting to load the initial web page generates a 500 error in the browser, and

2018-01-02 03:14:57: (mod\_fastcgi.c.2683) FastCGI-stderr: PHP Fatal error: Can't use function return value in write context in /var/www/html/pihole/index.php on line 108

in the error.log.

i have never gotten the web page to work, so i'm not trying to even save anything!

[update] i am accessing 192.168.0.5 (the pihole server); when i access 192.168.0.5/admin i do get the admin console, but the default lighttpd index.html still doesn't display and returns 500 error

tricorder: hv2yr3ih9v

---

<div class="post-metadata">

**Author:** ![driz](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/driz/32/2405_2.png) [@driz](https://discourse.pi-hole.net/u/driz)\
**Post date:** [January 2, 2018, 5:08am UTC](https://discourse.pi-hole.net/t/webmin-doesnt-save/6209/12 "2018-01-02T05:08:17Z")

</div>

I went ahead and did a full rebuild of the system. It's now debian 9 and everything is working properly.

---

<div class="post-metadata">

**Author:** ![DL6ER](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/dl6er/32/281_2.png) [@DL6ER](https://discourse.pi-hole.net/u/DL6ER)\
**Post date:** [January 2, 2018, 1:28pm UTC](https://discourse.pi-hole.net/t/webmin-doesnt-save/6209/14 "2018-01-02T13:28:21Z")

</div>

> [@iefbr14](#):
>
> 2018-01-02 03:14:57: (mod\_fastcgi.c.2683) FastCGI-stderr: PHP Fatal error: Can’t use function return value in write context in /var/www/html/pihole/index.php on line 108

Pinging @WaLLy3K on this. `pihole/index.php` is the blocking page.

---

<div class="post-metadata">

**Author:** ![iefbr14](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/i/ebca7d/32.png) [@iefbr14](https://discourse.pi-hole.net/u/iefbr14)\
**Post date:** [January 14, 2018, 10:25pm UTC](https://discourse.pi-hole.net/t/webmin-doesnt-save/6209/15 "2018-01-14T22:25:04Z")

</div>

After i created index.html (and renamed index.php) in `/var/www/html/pihole`, `http://192.168.0.5/pihole/` does bring up index.html ( and `http://192.168.0.5` returns a 404 error )

interesting that `http://192.168.0.5/pihole/` shows as `GET /pihole/ HTTP/1.1|304|0 ` in access.log instead of a 200...

---

<div class="post-metadata">

**Author:** ![petererdos](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/petererdos/32/2713_2.png) [@petererdos](https://discourse.pi-hole.net/u/petererdos)\
**Post date:** [February 6, 2018, 7:12pm UTC](https://discourse.pi-hole.net/t/webmin-doesnt-save/6209/16 "2018-02-06T19:12:26Z")

</div>

I also have (almost) this issue. Mine specifically is that i don't get the "blocking page" once i hit a blocked page (or [http://pi.hole/](http://pi.hole/) results in HTTP error 500). The error is similar:

`2018-02-06 20:09:20: (mod_fastcgi.c.434) FastCGI-stderr: PHP Fatal error: Can't use function return value in write context in /var/www/html/pihole/index.php on line 108`

I had to temporarily comment that specific line:

```
// Determine if at least one block list has been generated
//if (empty(glob("/etc/pihole/list.0.*.domains")))
// die("[ERROR] There are no domain lists generated lists within <code>/etc/pihole/</code>! Please update gravity by running <code>pihole -g</code>, or repair Pi-hole using <code>pihole -r</code>.");

```

I tried:  
pihole -r  
pihole -up

OS fully updated...  
Nothing seems to help.  
Everything else works fine, lists are being saved, updated...

OS details:  
centos-release-7-4.1708.el7.centos.x86\_64  
Kernel: Linux 3.10.0-693.17.1.el7.x86\_64  
SELinux disabled

---

<div class="post-metadata">

**Author:** ![petererdos](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/petererdos/32/2713_2.png) [@petererdos](https://discourse.pi-hole.net/u/petererdos)\
**Post date:** [February 6, 2018, 8:57pm UTC](https://discourse.pi-hole.net/t/webmin-doesnt-save/6209/17 "2018-02-06T20:57:25Z")

</div>

So I replaced the code with this:

```
if (!glob("/etc/pihole/list.0.*.domains"))
    die("[ERROR] There are no domain lists generated lists within <code>/etc/pihole/</code>! Please update gravity by running <code>pihole -g</code>, or repair Pi-hole using <code>pihole -r</code>.");

```

No more error 🙂
