简体   繁体   English

Symfony 2.3.5致命错误:在服务器上找不到类“ResourceBundle”

[英]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.

相关问题 Symfony2语言环境:: getDisplayCountries错误:找不到类ResourceBundle - Symfony2 Locale::getDisplayCountries Error: Class ResourceBundle not found 找不到Symfony 1.4致命错误'myUser'类 - Symfony 1.4 Fatal error Class 'myUser' not found Symfony:致命错误:在应用程序/控制台中找不到类 - Symfony: Fatal Error: Class not found in app/console 致命错误:在Linode Server中找不到类'mysqli' - Fatal error: Class 'mysqli' not found in Linode Server PHP致命错误:未捕获的错误:在Symfony上找不到类“ DOMDocument” - PHP Fatal error: Uncaught Error: Class 'DOMDocument' not found on Symfony 带有Symfony致命错误的PHPUnit:找不到类'Doctrine \\ Bundle \\ DoctrineBundle \\ DoctrineBundle' - PHPUnit with Symfony Fatal error: Class 'Doctrine\Bundle\DoctrineBundle\DoctrineBundle' not found Symfony:致命错误:找不到类'PHPUnit_Framework_TestCase' - Symfony: Fatal error: Class 'PHPUnit_Framework_TestCase' not found in Symfony3:致命错误:在 .\\bin\\console 中找不到“AppKernel”类 - Symfony3: Fatal error: Class 'AppKernel' not found in .\bin\console Symfony部署PHP致命错误:在AppKernel.php中找不到类 - Symfony deploy PHP fatal error: Class not found in AppKernel.php 找不到致命错误类 - Fatal Error class not found
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM