How does one edit a php.ini file?
Moderator: General Moderators
How does one edit a php.ini file?
Hello people, well the question couldn't be more explicit. I just learned how to view the php.ini configuration of my server using the phpinfo()script. But apparently it is a read only file. So how does one edit it? I am trying to extend session timeout. Thanks.
Re: How does one edit a php.ini file?
You can override the session timeout set in the php.ini file by doing something like this before calling session_start():
This would set the session timeout to eight hours.
Code: Select all
ini_set(’session.gc_maxlifetime’, 8 * 60 * 60);Re: How does one edit a php.ini file?
@greip, would the changes be visible in the phpinfo() script? because I just changed the gc maxlife variable but i still see the old value in the phpinfo() read only file.
Re: How does one edit a php.ini file?
Some server configurations allow you to create a "site" php.ini file, where you just place a text file named php.ini in the root of the web directory. This method, if allowed should show changes in phpinfo()
If I remember right (I could be wrong, been a while since I actually looked at phpinfo() output), but I thought it showed both the server settings AND the runtime (this call) settings.
Sorry I couldn't help more, I'm used to working on my own servers where I can change the main php.ini file.
-Greg
If I remember right (I could be wrong, been a while since I actually looked at phpinfo() output), but I thought it showed both the server settings AND the runtime (this call) settings.
Sorry I couldn't help more, I'm used to working on my own servers where I can change the main php.ini file.
-Greg
Re: How does one edit a php.ini file?
thanks greg