Setting php_admin_value or php_admin_flag for php-fpm instances

Hello,

I’m wondering if it’s possible to set the php_admin_value or php_admin_flag for php-fpm instances setup by InterWorx. I know you can put php_admin_value[memory_limit] = 512M in the php-fpm process config, but this is overwritten when InterWorx writes the config files again. I also know you can use ~iworx/bin/config.pex to configure specific php-fpm instances (as ~iworx/bin/config.pex --siteworx example.com --set --name FPM_MAX_CHILDREN --value 8), but I don’t see an option to set php_admin_* values.

Any ideas?

Thanks

Hi xmmedia

Have you just tried setting the value

Does it fail

Many thanks

John

Yes: adding a value to the specific php-fpm process config works (ie, php shows the new value) but as soon as InterWorx rewrites the config files, the added value is removed.

Hi xmmedia

I’m sorry I’ll have to have a think but one thing comes to mind, re php.ini settings, you could try create a /etc/php-fpm.ini in the siteworx root folder (not hosting folder /HTML) and see if that works. I believe it worked for php.ini user settings or the other thought is to add php-fpm to your .htaccess file

Many thanks

John

No problem. This lead me down another path.

Instead of having a separate file or modifying the interworx generated config file, I tried putting the config option directly in the main php-fpm config (www.conf) as:


[example.com]
php_admin_value[memory_limit] = 256M

Not completely ideal. The main issue being that if the siteworx is deleted, PHP will fail to start (confirmed). But it does work.

Also, of note: it doesn’t seem like the ~/etc/php.ini (or ~/etc/php-fpm.d/example.com.conf or anything else I tried) file is loaded by php-fpm. And putting values in the .htaccess doesn’t work either (causes Internal Server error because php is already running).

So, thanks for pointing me in the right direction. If you have any other better ideas, I’d love to hear them.