I'm trying to access an SQLite file on a CentOS7 box using PHP and the PDO library. I was getting read-only errors just like this question - https://stackoverflow.com/questions/3319112/sqlite-read-only-database
And per that question, the answer was to disable SELinux. That's fine for development, but for a production system I'd like to keep SELinux enabled.
How do I leave SELinux enabled, without getting read-only errors on the SQLite file?
(Note: The answers in that question that relate to it don't seem to be CentOS 7 compatible).
Edit: tail -f /var/log/audit/audit.log
type=AVC msg=audit(1543600144.088:1845): avc: denied { write } for pid=13968 comm="httpd" name="html" dev="dm-0" ino=50632493 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:httpd_sys_content_t:s0 tclass=dir
type=SYSCALL msg=audit(1543600144.088:1845): arch=c000003e syscall=2 success=no exit=-13 a0=5567d0b40859 a1=80042 a2=1ff a3=5567d0b40859 items=0 ppid=13674 pid=13968 auid=4294967295 uid=48 gid=48 euid=48 suid=48 fsuid=48 egid=48 sgid=48 fsgid=48 tty=(none) ses=4294967295 comm="httpd" exe="/usr/sbin/httpd" subj=system_u:system_r:httpd_t:s0 key=(null)
type=PROCTITLE msg=audit(1543600144.088:1845): proctitle=2F7573722F7362696E2F6874747064002D44464F524547524F554E44