douchao1957
2017-06-12 19:34
浏览 35
已采纳

SilverStripe - 模板可变投掷错误

I have a really basic function that I started. I began very simple with in code/Page.php:

public function createGreeting() {
    return 'hi';
}

In my Page.ss template, I have the variable: <% $createGreeting %>

Yet, this is killing the page. I checked the error logs, and it is showing:

PHP message: PHP Warning:  Director::protocolAndHost() lacks sufficient information - HTTP_HOST not set. in /usr/share/nginx/html/lungmap/framework/control/Director.php on line 488" while reading upstream, client: 31.210.102.114, server: 52.90.93.59, request: "GET / HTTP/1.0", upstream: "fastcgi://unix:/var/run/php/php5.6-fpm.sock:" 2017/06/12 12:34:50 [error] 1730#0: *6682 FastCGI sent in stderr: "PHP message: PHP Warning:  Director::protocolAndHost() lacks sufficient information - HTTP_HOST not set. in /usr/share/nginx/html/lungmap/framework/control/Director.php on line 488

Any idea what could be causing this? If I remove that line from Page.ss, the page loads perfectly fine.

图片转代码服务由CSDN问答提供 功能建议

我有一个非常基本的功能,我开始。 我开始非常简单,在 code / Page.php

  public function createGreeting(){
 return'hi'; 
} \  n   
 
 

在我的 Page.ss 模板中,我有变量:&lt;%$ createGreeting%&gt;

然而,这是在扼杀页面。 我检查了错误日志,它显示:

  PHP消息:PHP警告:Director :: protocolAndHost()缺少足够的信息 - 未设置HTTP_HOST。 在/usr/share/nginx/html/lungmap/framework/control/Director.php第488行“读取上游时,客户端:31.210.102.114,服务器:52.90.93.59,请求:”GET / HTTP / 1.0“,上游 :“fastcgi:// unix:/var/run/php/php5.6-fpm.sock:”2017/06/12 12:34:50 [错误] 1730#0:* 6682 FastCGI发送到stderr:“PHP 消息:PHP警告:Director :: protocolAndHost()缺少足够的信息 - 未设置HTTP_HOST。 在/usr/share/nginx/html/lungmap/framework/control/Director.php第488行
   
 
 

任何想法可能导致这种情况? 如果我从 Page.ss 中删除该行,页面加载完全正常。

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

1条回答 默认 最新

相关推荐 更多相似问题