Intl working fine with Symfony2 on WAMP, but shows an error in Functional Tests

萝らか妹 提交于 2019-12-11 08:05:28

问题


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:


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").



来源:https://stackoverflow.com/questions/27967876/intl-working-fine-with-symfony2-on-wamp-but-shows-an-error-in-functional-tests

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!