dtpyvb1873 2013-11-03 02:32
浏览 103

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

I'm using NameCheap host server with PHP Version 5.3.27 and no intl extension installed.

Although I try to put this lines in php.ini it still not work.

[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

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.

In case there isn't a solution, which host can I use?

Thanks in advance.

  • 写回答

1条回答 默认 最新

  • dongliaoqiang8524 2014-10-28 03:18
    关注

    As other people have suggested, you need intl extension. You have two options the first one is to use native c intl extension. Installation will depend on your operating system. Second option is to use symfony intl extension written in php. To install php extension just add

    "symfony/intl": "2.5.6"
    

    to the require section in your composer.json file. If the native intl extension is not available sf2 will failover to use php version instead. You can read more: here

    评论

报告相同问题?

悬赏问题

  • ¥15 keil的map文件中Image component sizes各项意思
  • ¥30 BC260Y用MQTT向阿里云发布主题消息一直错误
  • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
  • ¥15 划分vlan后,链路不通了?
  • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 Centos / PETGEM
  • ¥15 划分vlan后不通了
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)