Settings not being saved in admin portal when using apache instead of lighttpd

The username under which apache2 runs also needs to be a member of the pihole group to allow writing settings in particular folders (eg. /etc/pihole):
For the lighttpd web daemon that comes default with Pi-hole, this would be the www-data user OOTB:

pi@ph5b:~ $ ps -o uid,user,gid,group,pid,command -C lighttpd
  UID USER       GID GROUP      PID COMMAND
   33 www-data    33 www-data   437 /usr/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf
pi@ph5b:~ $ groups www-data
www-data : www-data pihole

If the apache2 daemon runs under the apache user (validate with the ps command), you would need to add the pihole group to the apache user with below:

sudo usermod -a -G pihole apache

And validate with below:

groups apache