This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use Stack Overflow.

Set the "date.timezone" setting in php.ini

Discuss installing Symfony 2 here

Set the "date.timezone" setting in php.ini

by Dal » Sat Mar 22, 2014 1:15 am

Hi Everyone

I'm new to this forum :)

I've searched the web and this forum for my problem with installing Symfony 2 and although I found posts with similar issues they don't seem to match exactly my issue (or the resolution doesn't work).

I'm using UniServer Zero XI as a WAMP Virtual Server on Windows 7.

I've got as far as loading the Symfony config file within the browser (http://localhost:8000/config.php) and I'm seeing 1 major problem:

1. Set the "date.timezone" setting in php.ini* (like Europe/Paris).

After looking at a few posts I've tried doing the following to resolve:

  • Identified the php.ini in use with UniServer Zero: C:\zero\core\php54\php_production.ini and checked the line - date.timezone = "Europe/London" (no semicolon and checked with PHP manual that Europe/London is a valid value.
  • Identified the php.ini which Symfony is using cmd "php app/check.php" which resolves at: Configuration file used by PHP: C:\zero\core\php54\php-cli.ini and checked the line - date.timezone = "Europe/London"
  • Copied my entire settings from C:\zero\core\php54\php_production.ini and put them into C:\zero\core\php54\php-cli.ini
  • The cmd "php app/check.php" also states OK on ALL checks
  • Used the cmd "php app/console cache:clear"
  • Restarted the server about 5,000 times
  • Restarted the computer 3 times

FYI: PHP Version 5.4.26 (Build Date:Mar 6 2014 06:37:24)

phpinfo() reports:
Virtual Directory Support: enabled
Configuration File (php.ini) Path: C:\Windows
Loaded Configuration File: C:\zero\core\php54\php_production.ini
Scan this dir for additional .ini files: (none)
Additional .ini files parsed: (none)
...
date/time support: enabled
"Olson" Timezone Database Version: 2013.9
Timezone Database: internal
Default timezone: Europe/London

I'm not sure why the value C:\Windows exists in the above settings but double checked that there are no php.ini files in there (or in sub-directories) using search term "*php*.ini"

php app/check.php reports:
C:\zero\www\starwarsevents>php app/check.php
********************************
* *
* Symfony requirements check *
* *
********************************

* Configuration file used by PHP: C:\zero\core\php54\php-cli.ini

** ATTENTION **
* The PHP CLI can use a different php.ini file
* than the one used with your web server.
* (especially on the Windows platform)
* To be on the safe side, please also launch the requirements check
* from your web server using the web/config.php script.

** Mandatory requirements **

OK PHP version must be at least 5.3.3 (5.4.26 installed)
OK PHP version must not be 5.3.16 as Symfony won't work properly with it
OK Vendor libraries must be installed
OK app/cache/ directory must be writable
OK app/logs/ directory must be writable
OK date.timezone setting must be set
OK Configured default timezone "Europe/London" must be supported by your installation of PHP
OK json_encode() must be available
OK session_start() must be available
OK ctype_alpha() must be available
OK token_get_all() must be available
OK simplexml_import_dom() must be available
OK APC version must be at least 3.1.13 when using PHP 5.4
OK detect_unicode must be disabled in php.ini
OK PCRE extension must be available

** Optional recommendations **

OK Requirements file should be up-to-date
OK You should use at least PHP 5.3.4 due to PHP bug #52083 in earlier versions
OK When using annotations you should have at least PHP 5.3.8 due to PHP bug #55156
OK You should not use PHP 5.4.0 due to the PHP bug #61453
OK When using the logout handler from the Symfony Security Component, you should have at least PHP 5.4.11 due to PHP bug #63379 (as a workaround, you can also set invalidate_session to false in the security logout handler configuration)
OK You should use PHP 5.3.18+ or PHP 5.4.8+ to always get nice error messages for fatal errors in the development environment due to PHP bug #61767/#60909
OK PCRE extension should be at least version 8.0 (8.32 installed)
OK PHP-XML module should be installed
OK mb_strlen() should be available
OK iconv() should be available
OK utf8_decode() should be available
OK intl extension should be available
OK intl extension should be correctly configured
OK intl ICU version should be at least 4+
OK a PHP accelerator should be installed
OK short_open_tag should be disabled in php.ini
OK magic_quotes_gpc should be disabled in php.ini
OK register_globals should be disabled in php.ini
OK session.auto_start should be disabled in php.ini
OK PDO should be installed
OK PDO should have some drivers installed (currently available: mysql)



http://localhost:8000/config.php page dump
Warning: date_default_timezone_get(): 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 the timezone 'UTC' for now, but please set date.timezone to select your timezone. in C:\zero\www\starwarsevents\app\SymfonyRequirements.php on line 441

Warning: date_default_timezone_get(): 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 the timezone 'UTC' for now, but please set date.timezone to select your timezone. in C:\zero\www\starwarsevents\app\SymfonyRequirements.php on line 442
Symfony
Search on Symfony website
Welcome!

Welcome to your new Symfony project.

This script will guide you through the basic configuration of your project. You can also do the same by editing the ‘app/config/parameters.yml’ file directly.
Major problems

Major problems have been detected and must be fixed before continuing:

Set the "date.timezone" setting in php.ini* (like Europe/Paris).

Recommendations

Additionally, to enhance your Symfony experience, it’s recommended that you fix the following:

Install and enable the mbstring extension.
Install and enable the intl extension (used for validators).
Install and enable a PHP accelerator like APC (highly recommended).
Set short_open_tag to off in php.ini*.
Install PDO drivers (mandatory for Doctrine).

* To change settings, create a "php.ini".

Re-check configuration

Symfony Standard Edition
Wow, it's beautiful outside. I should probably do something. Like close the blinds so there isn't a glare on my screen.
Dal
Junior Member
 
Posts: 1
Joined: Sat Mar 22, 2014 12:46 am