Topic: PHP directory ownership

Hello,
After we install PHP, these two directories are owned by root:apache

/var/lib/php/session/
/var/lib/php/wsdlcache/

Our webserver does not operate under root or apache, so PHP will give an error.
We can update the ownership of these directories to fix our problem, but every
time we "yum update", the ownership reverts back to root:apache and our website
does not work.

Is there a solution to this?

Re: PHP directory ownership

This directory have to be configured

Using mod_php, per vhost / user (see /etc/httpd/conf.d/php.conf)
    php_value session.save_path    "/var/lib/php/foo-session"
    php_value soap.wsdl_cache_dir  "/var/lib/php/foo-wsdlcache"

Using php-fpm, per pool (see /etc/php-fpm.d/www.conf)
   ; Set session path to a directory owned by process user
   php_value[session.save_handler] = files
   php_value[session.save_path]    = /var/lib/php/foo-session
   php_value[soap.wsdl_cache_dir]  = /var/lib/php/foo-wsdlcache

So, don't change permission of the apache directories, but create other directories for your users.

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi