Custom PHP settings while creating virtual server

2 posts / 0 new
Last post
#1 Sat, 08/08/2015 - 08:50
rikus

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 = "127.0.0.1:11211"

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.

Thu, 03/21/2019 - 10:28
ewake

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:

;https://www.virtualmin.com/node/37748
session.save_handler = memcached
session.save_path = "127.0.0.1:11211"
Topic locked