Does phpinfo () work with localhost timezone setting?

While running a php installation script for Blue.box (front end to FreeSwitch PBX), I get this error about a timezone failure.

Then I start digging. I'm not sure what is going on at this point. But here is what I have:

I created an info.php file in my public_html directory that contains a single line:

And I get this error and output

Warning: phpinfo(): It is not safe to rely on the system's timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/0default/public_html/info.php on line 1

date/time

     support    enabled
    "Olson" Timezone Database Version   0.system
    Timezone Database   internal
    Default timezone    America/New_York

    Directive   Local Value Master Value
    date.default_latitude   31.7667 31.7667
    date.default_longitude  35.2333 35.2333
    date.sunrise_zenith 90.583333   90.583333
    date.sunset_zenith  90.583333   90.583333
    date.timezone   America/New_York    America/New_York

I created a file /etc/php.d/timezone.ini with the following:

[root@mercury php.d]# cat timezone.ini
; default time zone
date.timezone='America/New_York'
[root@mercury php.d]#

I'm able to change timezone to America/Los_Angeles (for example), and after apache reboot the "date.timezone" field changes correctly.

But I still get the error.

Any ideas?

--- Additional note ---

If I change the /etc/php.d/timezone.ini file:

[root@mercury php.d]# cat timezone.ini
; default time zone
date.timezone='America/Los_Angeles'

I can cause a change to the info.php output:

date

Warning: phpinfo(): It is not safe to rely on the system's timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/0default/public_html/info.php on line 1

date/time support   enabled
"Olson" Timezone Database Version   0.system
Timezone Database   internal
Default timezone    America/New_York

Directive   Local Value Master Value
date.default_latitude   31.7667 31.7667
date.default_longitude  35.2333 35.2333
date.sunrise_zenith 90.583333   90.583333
date.sunset_zenith  90.583333   90.583333
date.timezone   America/Los_Angeles America/Los_Angeles

--- Additional note ---

For those who are learning (as I am), several .ini files are loaded. In the info.php output:

Configuration File (php.ini) Path   /etc
Loaded Configuration File   /home/0default/etc/php5/php.ini
Scan this dir for additional .ini files /etc/php.d
Additional .ini files parsed    /etc/php.d/curl.ini, /etc/php.d/dom.ini, /etc/php.d/fileinfo.ini, /etc/php.d/gd.ini, /etc/php.d/imap.ini, /etc/php.d/json.ini, /etc/php.d/mbstring.ini, /etc/php.d/mysql.ini, /etc/php.d/mysqli.ini, /etc/php.d/odbc.ini, /etc/php.d/pdo.ini, /etc/php.d/pdo_mysql.ini, /etc/php.d/pdo_odbc.ini, /etc/php.d/pdo_pgsql.ini, /etc/php.d/pdo_sqlite.ini, /etc/php.d/pgsql.ini, /etc/php.d/phar.ini, /etc/php.d/snmp.ini, /etc/php.d/sqlite3.ini, /etc/php.d/timezone.ini, /etc/php.d/wddx.ini, /etc/php.d/xmlreader.ini, /etc/php.d/xmlrpc.ini, /etc/php.d/xmlwriter.ini, /etc/php.d/xsl.ini, /etc/php.d/zip.ini

The first one loaded is /etc/php.ini, then the "loaded configuration file", then the "scan this dir" files.

So for example, one should be able to create a number of php web sites in different default timezones. Set the master default in /etc/php.ini, then allow each of the web sites to have a different time zone as identified in the "loaded..." section. Then, if one is concerned about any overrides, the master can again override with the /etc/php.d files.

I've tried changing the "date.timezone" in each of the three locations, and successfully change the date.timezone as displayed by the info.php... but it does not modify the "Default timezone" value, which is the value that is causing the error.

Another note, the .php script that I am running is actually Blue.box, a front end to FreeSwitch. So... I am hesitant in changing that .php script.

I'm trying to change the default PHP timezone to Asia/Calcutta by accessing the /etc/php5/cli/php.ini file and changing

[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
;date.timezone =

To

[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = "Asia/Calcutta"

But when I use phpinfo() to view the current timezone, it displays as Europe/Berlin time. Although I restarted and stopped the Apache server, the settings didn't appear to have changed.

Is there a step in the process that I'm overlooking?

How do I change the default timezone in PHP INI?

8 Answers.
Go to your phpinfo() page and search for Loaded Configuration File and open the php. ini file mentioned under that section..
Change the default timezone settings by adding your new timezone by modifying this line: date. timezone=Asia/Kolkata ..
Save the php. ... .
Restart the Apache server..

How can I modify the PHP timezone setting for my website?

Open Hosting → Manage → PHP Configuration page. There, open the PHP options tab and edit the date. timezone value: If you are not sure which time zone to insert, check the Time Zone Map.

What timezone is UTC for PHP?

The default timezone for PHP is UTC regardless of your server's timezone. This is the timezone used by all PHP date/time functions in your scripts. See PHP's list of supported timezones to find the names of all possible timezones you can use for the date.

What is the default time zone in PHP?

Reading the timezone set using the date_default_timezone_set() function (if any) Reading the value of the date. timezone ini option (if set) If none of the above succeed, the default timezone will be UTC.