
Uncomment the date.timezone function and set its value to the timezone you need. Defines the default timezone used by the date functions If it is not there, just add a line with the "date.timezone = Your/Timezone" function. sudo vi /etc/php.iniĭepending on the installed version of PHP version, you will find a section like the following.

On CentOS, the php.ini file is located at the /etc directory. For this guide, we will be using CentOS 6 with root privileges.

Sometimes you even get an error message on your webserver logs that clearly indicates this necessity.įortunately, this is easy to accomplish and we will show you how. PHP relies on the date.timezone value for some date/time functions executed by php-based applications.
