2017-06-12 13 views
1

私は本当に基本的な機能を持っています。私はcode/Page.phpで、非常にシンプル始まっ:このページを殺して、<% $createGreeting %>SilverStripe - テンプレート変数の投げ込みエラー

しかし:

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

Page.ssテンプレートでは、私は、変数を持っています。エラーログを確認したところ、表示されています:

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 

何が原因なのでしょうか? Page.ssからその行を削除すると、ページが完全に正常に読み込まれます。

+0

nginxの設定を共有できますか? [docsの例](https://docs.silverstripe.org/ja/3/getting_started/installation/how_to/configure_nginx/)を使って始めましたか、独自のものを使いましたか?とにかく、nginxが['$ http_host'パラメータを設定していないようです(https://stackoverflow.com/questions/15414810/whats-the-difference-of-host-and-http-host-in-nginx )正しく。 –

答えて

6

変数を<% %>ブロックにラップするのではなく、単に呼び出すだけです。

+1

/headdeskありがとう! – yondaimehokage

関連する問題