Custom PHP settings while creating virtual server

Hello forum users,

I’m having a problem to automatically activate Memcached on virtual server creation. Global php.ini has settings:
session.save_handler = memcached
session.save_path = “”

Save handler is copied correctly to new servers php.ini file, but save_path will be chaged to “/home/USER/tmp”.

Any solution to get this working automatically?

Also if you manually change these options to php.ini, editing these options in “PHP configuration -> Session options” is impossible, as there is no option for memcached and save_path won’t accept ip-address/port number.

I know it’s not a real solution, but it works…

Leave these default values in the .ini files in the folders /etc/php/7.x/cgi/php.ini, /etc/php/7.x/fpm/php.ini, etc.:

[Session] session.save_handler = files session.save_path = "/var/lib/php/sessions"


And create a /etc/skel/public_html/.user.ini file with these directives:

; session.save_handler = memcached session.save_path = ""