Question

I am having a bit of trouble understanding how to set up the php.ini file on my website. I have included the line session.cookie_lifetime = 1800 as well as some others, but nothing has changed. When I go to my phpinfo.php pgae, none of the settings I have configured in the .ini file are not taken into effect. Can anyone help me with this? Thanks.

Was it helpful?

Solution

When you make changes in the php.ini file you have to restart the webserver or reloading the configuration files in most cases.

Because I have not enough reputation yet to write comments I assume you are using a LAMP environment. You can restart the webserver by typing in console:

service apache2 restart

or

/etc/init.d/apache2 restart

reload or force-reload instead of restart should also work for just reloading the configuration files, but with restart you're one the safe side.

Also make sure you're editing the correct php.ini file. You can find the right file by looking at the 'Loaded Configuration File' directive of phpinfo() output.

OTHER TIPS

Add below lines in .htaccess file, it will increase the timeout to 30 minutes.

php_value session.cookie_lifetime 1800
php_value session.gc_maxlifetime 1800
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top