Bonjour.
/var/www/html/programme/script.php
/var/www/html/programme/database.sqlite
Depuis un client web, je veux lire un fichier sqlite avec script.php. Cette première partie fonctionne.
Lors de l'écriture j'ai une erreur rapporté par setroubleshoot.
Si je desactive SELinux je n'ai plus d'erreur et tout fonctionne.
Résumé : SELinux a empêché httpd d'reading and writing aux fichiers http.
SELinux prevented httpd reading and writing access to http files. Ordinarily httpd is allowed full access to all files labeled with http file context. This machine has a tightened security policy with the httpd_unified turned off, this requires explicit labeling of all files. If a file is a cgi script it needs to be labeled with httpd_TYPE_script_exec_t in order to be executed. If it is read-only content, it needs to be labeled httpd_TYPE_content_t, it is writable content. it needs to be labeled httpd_TYPE_script_rw_t or httpd_TYPE_script_ra_t. You can use the chcon command to change these contexts. Please refer to the man page "man httpd_selinux" or FAQ "TYPE" refers to one of "sys", "user" or "staff" or potentially other script types.
Changer le booléen "httpd_unified" sur vrai permettra cet accès : "setsebool -P httpd_unified=1"
Ceux qui ont suivis jusque là me diront sans doute de changer la valeur http_unified. Là ou cela devient drôle c'est qu'elle est déjà active.
Je recherche donc de l'aide pour pouvoir écrire dans un fichier sqlite avec un client web merci !