symfony1.4 I18nHelper.php 未找到
我将 symfony 1.4 项目从本地计算机 (Windows 7) 部署到我的测试服务器 (Linux Ubuntu Server)。 每当我通过浏览器(IE、FF...)打开这个项目时,我都会收到错误 500,这很可能是由于我从 log/frontend_staging 中获得的错误引起的:
"symfony [err] {InvalidArgumentException} Unable to load "I18nHelper.php" helper in: SF_ROOT_DIR/apps/frontend/lib/helper, SF_ROOT_DIR/lib/helper, SF_ROOT_DIR/lib/vendor/symfony/lib/helper."
文件 I18NHelper.php
位于 SF_ROOT_DIR/lib/vendor/symfony/lib/helper 中,所以我在那里没有看到问题。我已经开始尝试命名,虽然有些人提到他们在 Unix 系统上的 Helpers 名称中使用大写 N 时遇到了麻烦,但这根本没有解决我的问题。
I deployed my symfony 1.4 project from my local machine (Windows 7) to my test server (Linux Ubuntu Server).
Whenever I open this project through my browser (IE, FF...) I get an Error 500 which is most certainly caused due to an error which I get from the log/frontend_staging:
"symfony [err] {InvalidArgumentException} Unable to load "I18nHelper.php" helper in: SF_ROOT_DIR/apps/frontend/lib/helper, SF_ROOT_DIR/lib/helper, SF_ROOT_DIR/lib/vendor/symfony/lib/helper."
The File I18NHelper.php
is located in SF_ROOT_DIR/lib/vendor/symfony/lib/helper
, so I don't see a problem there. I already played with the naming, though some people mentioned they had trouble with the uppercase N in the Helpers name on Unix systems, but this didn´t solve my problem at all.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是一件非常令人讨厌的小事情:
使用
而不是
(注意最后一个“n”的大写)。
与 Windows 不同,Linux 区分大小写。
It's a very nasty little thing:
Use
<?php use_helper('I18N'); ?>
instead of<?php use_helper('I18n'); ?>
(Mind the upper case of the last 'n').Linux is case-sensitive, unlike Windows.
您拼错了助手的名字 最后一个“N”应该是大写的。
在模板中,它应该如下所示:
如果您正在修改 settings.yml,它应该如下所示:
您必须记住,symfony YAML 配置文件被缓存为 php 文件。如果您不清理缓存,您的更改将不会应用(当然取决于环境)。尝试使用:
从命令行,它应该修复它。
You have misspelled the helper's name The last "N" should be uppercase.
In templates it should look like:
If you are modifying the settings.yml it should look like:
You have to keep in mind that symfony YAML configuration files are cached as php files. If you don't clean your cache, your changes won't be applied (depending on the environment of course). Try using:
from command line, it should fix it.