Author Topic: PHP-FPM7.4 How can I set php.ini files per domain name  (Read 4124 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
PHP-FPM7.4 How can I set php.ini files per domain name
« on: July 28, 2021, 07:03:51 AM »
Hello,

I want to use php-fpm and to set a php.ini per each domain name (each php-fpm session to be served according to the ini file it has, per domain name).

Currently, even though the domains I have are running php-fpm, they all use the same configuration file loaded from
Code: [Select]
/opt/alt/php-fpm74/usr/php/php.ini

Considering I have different users using the domain names, sometimes several domain names per user, is it possible to serve PHP-FPM from individual ini files for each domain name and if so where/what should I set up?

Thank you!
« Last Edit: July 28, 2021, 07:06:39 AM by NIIcK »

Offline
*
Re: PHP-FPM7.4 How can I set php.ini files per domain name
« Reply #1 on: December 29, 2022, 03:06:09 AM »
I have the same question, did you find the answer?

I am using PHP-FPM , and i need to set memory limit changes for just one domain. Thats not on CWP wiki as far as i know.

Offline
*****
Re: PHP-FPM7.4 How can I set php.ini files per domain name
« Reply #2 on: February 05, 2023, 05:37:42 AM »
Look here:
/opt/alt/php-fpm74/usr/etc/php-fpm.d/users/yourdomain.conf

The PHP documentation indicates
Quote
FPM uses php.ini syntax for its configuration file - php-fpm.conf, and pool configuration files.

Example #1 Passing environment variables and PHP settings to a pool
Code: [Select]
php_flag[display_errors] = off
php_admin_value[error_log] = /var/log/fpm-php.www.log
php_admin_flag[log_errors] = on
php_admin_value[memory_limit] = 32M