After upgrade to 16.0 selinux block php script in my apache2 http server

on my desktop pc running leap 16.0 and kde I have a small http apache2 server where a php script gives the content of some folders.
before the upgrade with 15.6 everything worked well, after the upgrade with 16.0 it doesn’t works.
I suspected that was selinux so I booted with selinux=0 kernel option and everything works well, so I suspect is selinux that block the access to the folders.

the script is in /srv/www/htdocs/list/lista-film-2026-01-24gen.phpand when I run http://localhost/list/lista-film-2026-01-24gen.phpit gives me no result

film presenti nella cartella /home/users/abbaino-ext/cesso
the (part of the) script is this:

<?php
.....(snipped)
$dir1000 = "/home/users/abbaino-ext/cesso";
....(snipped)
$dir = $dir1000; 
echo  "<I> <font color=red>"."<b>"." film presenti nella cartella   </b>". $dir."</font> </I>"."<br />"."</b>";
if ($handle = opendir($dir))
{
   while (false !== ($file = readdir($handle)))
   {
      if ($file != "." && $file != "..")
      {
           echo "$file\n"."<I> <font color=red>"."in ".$dir."</font> </I>"."<br>";
      } 
   }
   closedir($handle);
}
#-------------

$dir = $dir1000; echo "<br>"."<br>";
echo  "<I> <font color=red>"."<b>"." film presenti nella cartella   </b>". $dir."</font> </I>"."<br />"."</b>";
if ($handle = opendir($dir))
{while (false !== ($file = readdir($handle)))
{if ($file != "." && $file != "..")
{echo "$file\n"."<I> <font color=red>"."in ".$dir."</font> </I>"."<br>";} }
closedir($handle);}
#-------------

Please show the result of

ls -alZ /srv/www/htdocs

On my machine it looks like this

> ls -alZ /srv/www/htdocs
total 36
drwxr-xr-x.  6 root   root system_u:object_r:httpd_sys_content_t:s0     4096 Mai  6 17:28 .
drwxr-xr-x.  4 root   root system_u:object_r:httpd_sys_content_t:s0     4096 Jan  4 21:47 ..
-rw-rw----.  1 wwwrun www  unconfined_u:object_r:httpd_sys_content_t:s0  302 Mär 13  2006 favicon.ico
-rw-rw----.  1 wwwrun www  unconfined_u:object_r:httpd_sys_content_t:s0  239 Jan 21  2021 index.php
>

here is

procuste@server3TW:~> ls -alZ /srv/www/htdocs
total 5660
drwxr-xr-x. 14 root root system_u:object_r:httpd_sys_content_t:s0    4096 Apr  1  2025 .
drwxr-xr-x.  6 root root system_u:object_r:httpd_sys_content_t:s0    4096 Apr  1  2025 ..
drwxr-xr-x.  2 root root system_u:object_r:httpd_sys_content_t:s0    4096 May 28  2016 amici
-rw-rw-rw-.  1 root root system_u:object_r:httpd_sys_content_t:s0    2326 Nov 20  2004 apache_pb.gif
-rw-rw-rw-.  1 root root system_u:object_r:httpd_sys_content_t:s0    1385 Nov 20  2004 apache_pb.png
-rw-rw-rw-.  1 root root system_u:object_r:httpd_sys_content_t:s0    2410 Dec 14  2005 apache_pb22.gif
-rw-rw-rw-.  1 root root system_u:object_r:httpd_sys_content_t:s0    1502 Dec 14  2005 apache_pb22.png
-rw-rw-rw-.  1 root root system_u:object_r:httpd_sys_content_t:s0    2205 Dec 14  2005 apache_pb22_ani.gif
drwxr-xr-x.  2 root root system_u:object_r:httpd_sys_content_t:s0    4096 Oct 12  2008 autentication
-rw-rw-rw-.  1 root root system_u:object_r:httpd_sys_content_t:s0  346912 Jan 19  2011 coduzzi.html
-rw-rw-rw-.  1 root root system_u:object_r:httpd_sys_content_t:s0 5336642 Feb 10  2008 elencoweb.html
drwxr-xr-x.  6 root root system_u:object_r:httpd_sys_content_t:s0    4096 Jan  8  2011 ero
-rwxrwxrwx.  1 root root system_u:object_r:httpd_sys_content_t:s0     135 Jan  8  2008 ero2.php
drwxr-xr-x.  2 root root system_u:object_r:httpd_sys_content_t:s0    4096 Mar 19  2025 gif
drwxr-xr-x.  3 root root system_u:object_r:httpd_sys_content_t:s0    4096 Jul  3  2016 il_viaggio_e_rivoluzione
drwxr-xr-x.  2 root root system_u:object_r:httpd_sys_content_t:s0    4096 Dec 12  2014 images
-rw-rw-rw-.  1 root root system_u:object_r:httpd_sys_content_t:s0      44 Nov 20  2004 index.html.orig
-rw-r--r--.  1 root root system_u:object_r:httpd_sys_content_t:s0      45 Jun 11  2007 index.html.rpmnew
-rw-rw-rw-.  1 root root system_u:object_r:httpd_sys_content_t:s0      44 Nov 20  2004 index.html.rpmsave
-rw-r--r--.  1 root root system_u:object_r:httpd_sys_content_t:s0    2356 Mar 19  2025 info2html.css
drwxr-xr-x.  5 root root system_u:object_r:httpd_sys_content_t:s0    4096 Apr 29  2012 io
drwxr-xr-x.  3 root root system_u:object_r:httpd_sys_content_t:s0    4096 Jun 17 19:08 list
drwxr-xr-x.  2 root root system_u:object_r:httpd_sys_content_t:s0    4096 Feb 18  2007 list-amici
-rw-rw-rw-.  1 root root system_u:object_r:httpd_sys_content_t:s0    8710 Nov 14  2020 lista-film-2020.php
drwxr-xr-x.  2 root root system_u:object_r:httpd_sys_content_t:s0    4096 May 29 17:25 nut
drwxr-xr-x.  5 root root system_u:object_r:httpd_sys_content_t:s0    4096 Feb 18  2007 script-php
drwxr-xr-x. 15 root root system_u:object_r:httpd_sys_content_t:s0    4096 Sep 28  2014 zm
procuste@server3TW:~> 

I tried on my pc and it works, I don’t know if this is enough to comply with forum rules on AI

@pier_andreit Please see https://forums.opensuse.org/faq and the “AI-Generated Content” section, your post and solution does not meet the requirements.

Likewise there is Cockpit integration for SELinux troubleshooting and also a side panel link to the SELinux Portal for troubleshooting and potentially a bug report so the appropriate policy can be updated.