Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Ok I have a VPS running Ubuntu Server 12.10 32Bit and I need to set the timezone in my PHP.ini file so my PHP Script's time and date features will work (I am trying to setup ModX) I have tried to go to /etc/php5 and change it in different files and it won't work. How do I change PHP's timezone. Also everything in the .ini file has a ; in front of it is that a comment or what? Also I forgot to mention that my webserver in installed via tasksel as LAMP.

share|improve this question
    
Have you tried restarting your server ? –  Ye Lin Aung Feb 23 '13 at 17:31
    
I have not restarted my serer but I restarted the Apache service. –  Nathan Suchy Feb 23 '13 at 17:33

1 Answer 1

find your php.ini and change the value of date.timezone = Europe/Berlin

Edit(Thanks to @awashburn for his comment): the php-cli's php.ini file is different then apache2's php.ini file. I suggest symbolic linking one to another to keep them in sync and avoid confusion!

share|improve this answer
    
Which .ini file do I use? Where is the file located for Apache2? –  Nathan Suchy Feb 23 '13 at 17:32
    
I use xampp myself. but in your case I think it is in /etc, try t o search in your filesystem with find | grep php.ini –  Mostafa Shahverdy Feb 23 '13 at 17:34
    
Ok please refersh this page in 10 minutes as I am going to try /etc/apache2/php.ini then restart my VPS and see if that works. –  Nathan Suchy Feb 23 '13 at 17:35
1  
Note: the php-cli's php.ini file is different then apache2's php.ini file. I suggest symbolic linking one to another to keep them in sync and avoid confusion! –  recursion.ninja Feb 15 at 19:43
1  
this is the file he meant /etc/php5/apache2/php.ini –  Olu Doug Feb 15 at 21:05

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.