OK, as I posted before, I did not go into deep details, on why this happens. My guess would be if it's not OS dependent, then it might depend on particular PHP scripts, CMS you're running there. Maybe some PHP written software is smart enough to not fail if session_path is not set in PHP.INI, or they redefine its path to something within document root, the other sites might give a warning that "session.save_path" is not set. Anyway if you don't see the error, that's good.
By the way, it was mentioned somewhere that to have session.save_path to point into /tmp is not very secure, as a hacker with a hosting account on your server might hijack a session from a neighbor site, if he manages to get list of files located in /tmp. To prevent this you might want to store sessions in user home directory, e.g.
Code:
session.save_path=/home/userbob/tmps_sessions
to make it work, you should in virtual host set a directive under line
Code:
php_admin_flag engine |PHP|
add
Code:
php_admin_value session.save_path=|HOME|/tmps_sessions
in
/usr/local/directadmin/data/templates/custom/virtual_host2.conf
/usr/local/directadmin/data/templates/custom/virtual_host2_secure.conf
/usr/local/directadmin/data/templates/custom/virtual_host2_secure_sub.conf
/usr/local/directadmin/data/templates/custom/virtual_host2_sub.conf
and update/create
/usr/local/directadmin/scripts/custom/user_create_post.sh
and add lines
Code:
DIR=/home/$username
mkdir "$DIR/tmp_sessions"
chown $username:$username "$DIR/tmp_sessions"
chmod 700 "$DIR/tmp_sessions"
By the way, the fact it is insecure to store PHP sessions in /tmp directory might be the reason why it's commented in the default PHP.INI and why some PHP scripts define their own session storage.