Recently I came to address a problem related to PHP. As part of the troubleshooting steps, I had to change the user in which the php fpm service runs. The operating system was CentOS 8 Linux.
The following are the steps I followed to change the user of PHP FPM.
Step 1: Open the http://www.conf file
/etc/php-fpm.d/www.conf
Step 2: Modify the user and group details in the configuration file
The screenshot of the same is given below. Modify the user and group as per your requirement.

Step 3: Restart PHP FPM service
service php-fpm restart
Step 4: Verify the changes
After the restart, verify the process and check whether the process is running as the updated user.
ps -aux | grep php-fpm
I hope this tip is helpful. Feel free to comment your queries or feedbacks.