[英]Symfony 2.3.5 Fatal error: Class 'ResourceBundle' not found on Server
I'm using NameCheap host server with PHP Version 5.3.27 and no intl extension installed. 我正在使用带有PHP版本5.3.27的NameCheap主机服务器并且没有安装任何intl扩展。
Although I try to put this lines in php.ini
it still not work. 虽然我尝试将这些行放在php.ini
但它仍然不起作用。
[PHP]
detect_unicode = off
suhosin.executor.include.whitelist="phar"
date.timezone=Europe/Berlin
short_open_tag = off
magic_quotes_gpc = off
extension=pdo.so
extension=pdo_mysql.so
extension=intl.so
extension=php_intl.dll
[intl]
intl.default_locale = en_utf8
intl.error_level = E_WARNING
So, when I execute my web, I have this issue: 所以,当我执行我的网站时,我遇到了这个问题:
FatalErrorException: Error: Class 'ResourceBundle' not found in /home/esdrhazc/vendor/symfony/symfony/src/Symfony/Component/Intl/ResourceBundle/Reader/BinaryBundleReader.php line 31
To avoid this problem I added next lines to autoload.php
为了避免这个问题,我在autoload.php
添加了下一行
use Doctrine\Common\Annotations\AnnotationRegistry;
use Composer\Autoload\ClassLoader;
/**
* @var ClassLoader $loader
*/
$loader = require __DIR__.'/../vendor/autoload.php';
// intl
if (!function_exists('intl_get_error_code')) {
require_once __DIR__.'/../vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/stubs/functions.php';
$loader->add('', __DIR__.'/../vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/stubs');
$loader->registerPrefixFallbacks(
array(__DIR__.'/../vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/stubs')
);
}
$loader->add('Gestor', __DIR__.'/../src');
AnnotationRegistry::registerLoader(array($loader, 'loadClass'));
return $loader;
What more can I do? 我还能做什么? Its strange because if i navigate inside host, the previous path doesn't exist, the corrects are: 它奇怪,因为如果我在主机内导航,前一个路径不存在,更正是:
/../vendor/symfony/symfony/src/Symfony/Component/Locale/stubs
but I try to change it and it still doesn't work. 但我试着改变它,它仍然无法正常工作。 And, I can't find functions.php
. 而且,我找不到functions.php
。
In case there isn't a solution, which host can I use? 如果没有解决方案,我可以使用哪个主机?
Thanks in advance. 提前致谢。
As other people have suggested, you need intl
extension. 至于其他人建议,需要intl
扩展。 You have two options the first one is to use native c
intl
extension. 你有两个选择,第一个是使用native c
intl
扩展。 Installation will depend on your operating system. 安装取决于您的操作系统。 Second option is to use symfony intl
extension written in php
. 第二个选项是使用php
编写的symfony intl
扩展。 To install php
extension just add 要安装php
扩展,只需添加即可
"symfony/intl": "2.5.6"
to the require
section in your composer.json
file. 到composer.json
文件中的require
部分。 If the native intl
extension is not available sf2
will failover to use php
version instead. 如果本机intl
扩展不可用,则sf2
将故障转移以使用php
版本。 You can read more: here 你可以阅读更多: 这里
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.