PHP session.save_path

ju5t

Verified User
Joined
Sep 14, 2005
Messages
399
Location
Amsterdam
First off, I'm not completely sure if this is a configuration setting for PHP or if it's as designed or an error in Apache, so please let me know if I'm mistaken here.

I am trying to get PHP to use custom temporary folders for both sessions and uploaded files. While normal scripts seem to have no issues, webapps are failing to write session data.

In my example, let's say we use domain.com with the user domain. We have a custom php.ini in /usr/local/directadmin/data/users/domain/php/php.ini which is loaded at runtime. Within this configuration, we enforce session.save_path to be /home/domain/tmp. No problems so far. Normal scripts are functioning as the scripts are owned by the user 'domain'. Once phpmyadmin or squirrelmail are accessed, it seems that the script runs as 'webapps' and loads the configuration php.ini of 'domain'. Therefore, the session.save_path setting of 'domain' is enforced, while it either should go default or run completely under the user 'domain'.
 
Last edited:
Seems to be solved if I enforce

Code:
SetEnv PHP_INI_SCAN_DIR

on the /var/www/html directory. This makes sure no custom ini files are scanned. Thus defaults session.save_path to /tmp. Apache probably loads the 'domain' config first - then starts on the 'webapps' config where it found the PHP_INI_SCAN_DIR variable was not overruled. That makes sense in a way.
 
Last edited:
Back
Top