PHP-FPM: generated config uses non-overridable session.save_path

FNDRNS

Verified User
Joined
Dec 14, 2020
Messages
9
Apparently when DirectAdmin generates per-user php-fpmXY.conf files, it uses php_admin_value[session.save_path] = /home/username/tmp

Now, since it uses an admin value, there's no way to override this using a per-domain .user.ini or even with ini_set(). For now I just sed'd all config files to turn it into a regular php_value and reloaded fpm. That works, but I'm pretty sure those changes will be lost eventually.

Perhaps there's a directadmin.conf option to change this behaviour?
 
Any ideas? Every update for PHP-FPM reverts all the configs to the admin variant.
 
I'm not entirely sure which section you mean, I think "I wish to have global custom PHP-FPM configuration"? I didn't actually know about this particular document but I think it's not quite going to work. It looks like you're creating a custom config and DirectAdmin will inject that in place of a CUSTOM1 or CUSTOM2 token in other configs. But that still leaves a few problems:
* php_admin_values are not overridable to begin with, so the default config must be changed regardless
* The session path is usually under a user home directory, with a global config they should be changed to a global/shared dir (e.g. /tmp) which is something everyone should be trying to avoid
* Constantly keeping track of per-user configs is a major pain, especially when the amount of users is in the triple digits

Now, I could modify the default php-fpmXY.conf configs to include those CUSTOM tokens, but once again any PHP-FPM update will cause DirectAdmin to rewrite the base configs and my changes will be lost.
 
option to change this behaviour?
So not entirely sure which behavior you are looking to change?
I wish to have global custom PHP-FPM configuration
This is the one I was thinking you wanted.
DirectAdmin will inject that in place of a CUSTOM1 or CUSTOM2 token in other configs.
This
modify the default php-fpmXY.conf configs to include those CUSTOM tokens
does this.

What is it you really wish to do? What about is the Standard config not ok?
 
What about is the Standard config not ok?
Well the "core" of the problem is that the currently generated config uses php_admin_value instead of just php_value, but CMSes might use their own session save path and they wouldn't be able to override it. I'm looking for a way so that the generated config by default uses php_value (for at least the session.save_path setting), i.e. without having to do some modifications after generation.
 
Well the "core" of the problem is that the currently generated config uses php_admin_value instead of just php_value, but CMSes might use their own session save path and they wouldn't be able to override it. I'm looking for a way so that the generated config by default uses php_value (for at least the session.save_path setting), i.e. without having to do some modifications after generation.


just create/edit file on "data/templates/custom/"
Code:
cd /usr/local/directadmin/data/templates/
cp php-fpm.conf custom/php-fpm.conf
cd /usr/local/directadmin/custombuild
./build rewrite_confs
 
That works, thanks. I'll just have to remember to diff the default php-fpm.conf against the custom one to account for any changes after an update. =]
 
Back
Top