Php.ini in a vhost environment

My server structure uses virtual hosts to handle multiple web sites. The root directory for each site is /var/www/vhosts/myapp1/httpdocs/ where httpdocs is the root directory for the myapp1 site. Myapp2 would be a separate directory under vhosts. The php.ini file is in /etc/php.ini where /etc/ is on the same level as /var/.

I have some specific configuration lines in the php.ini files to handle session variables in myapp1 which at the time was the only active site. For example, there are lines

session.save_path = "/var/www/vhosts/ and session.cookie_domain = ""

Since those are the only lines in the php.ini file regarding session cookie stores, myapp2 is having problems going between ssl and non-secured pages whereas myapp1 does that just fine.

So the question is how do I configure php.ini to handle multiple vhosts?


Use .htaccess and set session.save_path there.

Thanks, exactly what I was looking for I hope.

Okay, I tried it and put the following in the .htaccess file for the site

php_value session.save_handler files
php_value session.save_path /var/www/vhosts/
php_value session.cookie_domain
php_value html_errors On
php_value track_errors On
php_value display_startup_errors On 
php_value display_errors On
php_value error_reporting E_ALL|E_STRICT

Yes, it is a development site.

I still don’t get session variables on the https pages, however, at this point I do not have a dedicated ssl cert. I am in the process of doing that to see if that helps. From reading, I think that was one of the potential problems, is that correct?


This is off track as to what my problem is at this point so close this and I will start a new thread. Thanks