【发布时间】:2013-03-05 16:36:18
【问题描述】:
我正在处理一个遗留的 symfony 1.4 项目,我在我的办公室 linux 机器 Fedora 16 上设置了我的本地开发环境,一切都很顺利。我不得不用 Mac OS X Lion 为 macbook 机器重新创建环境。
在第二个我收到大量这样的错误
[Mon Mar 04 16:51:58 2013] [error] [client ::1] PHP Fatal error: Uncaught exception 'sfRenderException' with message 'The decorator template "layout.php" does not exist or is unreadable in "".' in /Users/foo/bar/baz/myApp/v2/cache/something/something/config/config_core_compile.yml.php:3875\nStack trace:\n#0 /Users/foo/bar/baz/myApp/cache/something/something/config/config_core_compile.yml.php(3909)
所以在那个 config_core_compile.yml.php 文件中,这段代码中抛出了异常
if (!is_readable($this->getDecoratorDirectory().'/'.$this->getDecoratorTemplate()))
{
throw new sfRenderException(sprintf('The decorator template "%s" does not exist or is unreadable in "%s".', $this->decoratorTemplate, $this->decoratorDirectory));
}
跟踪 getDecoratorDirectory 方法调用,我在第 175 行附近找到了 sfView.class.php
public function getDecoratorDirectory()
{
return $this->decoratorDirectory;
}
在同一个文件中,decoratorDirectory 属性被“计算/填充”,但它是空白的,你知道什么地方可能出错了吗?一个 symfony 设置,一个 apache 配置?有什么事吗?
P.S 以防万一这是我的 apache vhost
<VirtualHost *:80>
ServerName local.myapp
DocumentRoot /Users/foo/bar/baz/myApp/v2/web
ErrorLog "/private/var/log/apache2/local.myapp-error_log"
CustomLog "/private/var/log/apache2/local.myapp-access_log" combined
<Directory "/Users/foo/bar/baz/myApp/v2/web">
Options FollowSymLinks
AllowOverride All
Allow from All
</Directory>
Alias /sf /Users/foo/bar/baz/myApp/v2/web/lib/vendor/symfony/data/web/sf
<Directory "/Users/foo/bar/baz/myApp/v2/web/lib/vendor/symfony/data/web/sf">
AllowOverride All
Allow from All
</Directory>
</VirtualHost>
编辑: 另外我必须使用 perforce 公司 repos,一位年长的队友一直说他认为是关于编码,这对我来说没有意义,但仍然。
【问题讨论】:
-
嘿,Elnur 和 j0k,你好吗?你做了什么编辑?
-
你使用的是同一个apache,同一个php吗?
layout.php文件是否存在于您的应用程序的模板文件夹中?你清除缓存了吗? -
如果我没记错的话,在 linux 盒子里我有 apache 2.2,php 是 5.4。* 在 mac 盒子里,我有 php 5.3.15 和 Apache/2.2.22 (Unix) DAV/2 Suhosin-Patch 是的,我已经多次清除缓存文件夹。我在项目中有多个 symfony 应用程序,除了一个之外,它们的模板文件夹中都有 layout.php 文件,正在查看它......
-
j0k,所以 decoratorDirectory 属性为空是正常的吗?
-
您在
vhost中对alias的定义有误。路径应该是../myApp/v2/lib/vendor...所以没有web部分。虽然我不认为这是你的问题的原因。
标签: php macos apache symfony-1.4