Monday, December 19, 2016

Change timezone to Apache server , PHP and MySql in XAMPP

Change timezone to Apache server , PHP and MySql in XAMPP
I have installed XAMPP in my Windows machine and I want to alter the timezone in Apache HTTP server, PHP module and MySql in order to see proper dates in server error.log, access.log and php_error_log output.
After some searching I found the solution:

1. In httpd.conf (\xampp\apache\conf\httpd.conf) , add the following line:

# Set timezone to Europe/Athens UTC+02:00
SetEnv TZ Europe/Athens

2. Edit php.ini (\xampp\php\php.ini) date.timezone value in [Date] section:

date.timezone = "Europe/Athens"
You can find the available PHP timezones in

3. In my.ini (\xampp\mysql\bin\my.ini) add or replace

default-time-zone = "Europe/Athens"
Now restart Apache HTTP and MySQL server and you are done!
Set timezone to Africa/Harare

Import database in phpmyadmin XAMPP if got error like this... "No data was received to import. Either no file name was submitted, or the file size exceeded the maximum size permitted by your PHP configuration."

try to edit after change into php.ini :
upload_max_filesize = 10M 
post_max_size = 20M 
memory_limit = 128M

MSc BIT BSc HND Edxcel PHP Web Application Projects Assignments Guidance.
London A/L O/L ICT Class
Individual / Group / Online classes in English / Sinhala / Tamil. Sample PHP Projects/Assignments Exam Papers, Tutorials, Notes and Answers will be provided. Call +94 777 33 7279 | eMail | Skype ITClassSL