Good deduction
SELinux define some files context which are visible by command ls -alZ.
By default /srv/www/htdocs is the apache root directory and have context:
philippe@hpprol2:/srv/www/htdocs> ls -alZ
total 72
drwxr-xr-x. 13 root root system_u:object_r:httpd_sys_content_t:s0 4096 janv. 4 21:47 .
drwxr-xr-x. 7 root root system_u:object_r:httpd_sys_content_t:s0 4096 janv. 4 21:47 ..
drwxr-xr-x. 2 wwwrun www system_u:object_r:httpd_sys_content_t:s0 4096 juil. 13 2014 backup
drwxr-xr-x. 25 wwwrun www system_u:object_r:httpd_sys_content_t:s0 4096 janv. 20 2023 catalog
drwxr-xr-x. 16 wwwrun www system_u:object_r:httpd_sys_content_t:s0 4096 juil. 18 12:21 gedview
drwxr-xr-x. 17 wwwrun www system_u:object_r:httpd_sys_content_t:s0 4096 déc. 9 2021 gedview7302
drwxr-xr-x. 2 wwwrun www system_u:object_r:httpd_sys_content_t:s0 4096 févr. 11 2021 gif
drwxr-xr-x. 33 wwwrun www system_u:object_r:httpd_sys_content_t:s0 4096 août 30 2019 obiblio1
drwxr-xr-x. 18 wwwrun www system_u:object_r:httpd_sys_content_t:s0 4096 juil. 15 2019 openbiblio
drwxr-xr-x. 3 root root system_u:object_r:httpd_sys_content_t:s0 4096 oct. 22 2019 phpldapadmin
drwxr-xr-x. 16 wwwrun www system_u:object_r:httpd_sys_content_t:s0 4096 déc. 10 11:16 piwigo
-rw-r--r--. 1 wwwrun www system_u:object_r:httpd_sys_content_t:s0 43 janv. 8 2020 a.gif
-rw-rw-rw-. 1 wwwrun www system_u:object_r:httpd_sys_content_t:s0 77 déc. 24 2019 check_pear.php
-rw-r--r--. 1 wwwrun www system_u:object_r:httpd_sys_content_t:s0 67 juin 5 2021 find_php_ini.php
-rw-r--r--. 1 wwwrun www system_u:object_r:httpd_sys_content_t:s0 2356 févr. 11 2021 info2html.css
-rw-rw-r--. 1 wwwrun www system_u:object_r:httpd_sys_content_t:s0 69 févr. 27 2014 phpinfo.php
philippe@hpprol2:/srv/www/htdocs>
The ‘httpd_sys_content’ give read access for apache2. If apache2 needs saving some data in one of this directory or subdirectory you need to set the context to “httpd_sys_rw_content” on the files or on the directory.
Be aware that SELinux semanage command use alias for /srv/www/htdocs → /var/www see file /etc/selinux/targeted/contexts/files/file_contexts.subs_dist
Regards
Philippe