1
votes

I have a quite strange issue here!

I am using Symfony2 with WAMP. When I visualise a path, lets say

mylocaldomain/blog/see_all

it works fine (Intl extension on PHP works fine).

However, when I build a functional test, there is this issue

500 Internal Server Error - Twig_Error_Runtime:
An exception has been thrown during the rendering of a template
("The Symfony\Component\Intl\DateFormatter\IntlDateFormatter::__construct() method's argument $locale value NULL behavior is not implemented. Only the locale "en" is supported. Please install the "intl" extension for full localization capabilities.") in ...

I think 2 version of php.ini were used. If this is the problem, how to know which one is used for tests?

If this is not the problem, any clues?

1
run php --ini from the command line. you might have to use full path to php if you don't have it on your PATH env variable.Himal
Thank you Himal, I tried to add the path to php.ini to the path. I still do not work. What do you mean by using the full php path? Where? in the test command?virtualmail
No, you don't have to add php.ini path to the PATH varaible.i meant the php executable so you can just type php --ini from the command line.it'll show you the ini file used by the tests/command line tools.Himal
It works! thanks a lot Himal! If you want to answer, i'll mark it as resolved!virtualmail
Glad to hear that. no worries, you can post what you did as an answer and mark it as a correct answer.Himal

1 Answers

1
votes

Thanks to @Himal (see comments above), here is the solution:

The php.ini used by the WAMP and by the console are not the same (php --ini for the one in the console).

I enabled in both of them the Intl extension

extension=php_intl.dll

Another solution is to make the console, use the same file as WAMP (I did not explore this solution, but it seems to me to be "cleaner").