I think we all come across times where we need to have custom php.ini settings for a web-application. One such instance has come up with an application that I have written and recently deployed for Larkin Mortuary. We needed Zend Framework components and I needed session times to be longer. Now the second need is something that is very specific to just this application. There are other applications on this server that we would not want a longer session time.
So I decided to use the apache config file to get custom settings per application. I got a bunch of info from this php page http://php.net/manual/en/configuration.changes.php.
Now my apache config file contains the following:
php_value include_path ".:/usr/local/lib/php:/opt/ZendFramework-1.10.8/library"
php_value session.gc_maxlifetime "28800"
php_value session.cookie_lifetime "28800"
We can see these changes taken place if we look at the output from phpinfo():
Directive Local Value Master Value
session.cookie_lifetime 28800 0
session.gc_maxlifetime 28800 1440
I also understand that you can have custom php.ini files for each application. But why when you are going to have a VirtualHost section for each application anyways?