状況:
サーバー A とサーバー B には、同じ Ubuntu 14.04、同じ nginx バージョン (1.4.6)、同じ仮想ホスト (domain.com)、および joomla フォルダー (サーバー A から B に rsync) がインストールされています。
しかし、サーバー A はフロント ページしか表示できず、どのメニュー項目にも「ファイル入力が指定されていません」と表示されます。
サーバー B をテストした後、サーバー A の IP が domain.com を使用するように /etc/hosts を変更した場合、すぐには失敗しません。数分後にのみ、そのエラーが表示されます。
nginx のエラー ログには、以下のようなメッセージがいくつかあります。
2015/02/23 12:01:57 [error] 15515#0: *260609 FastCGI sent in stderr: "PHP message: PHP Notice: Undefined property: JPagination::$pagesTotal in /var/www/joomla/templates/ashton/html/com_content/featured/default.php on line 76" while reading response header from upstream, client: 10.224.202.152, server: www.domain.com, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "www.domain.com"
答え1
「fastcgi_param SCRIPT_FILENAME」を追加することで解決しました
以下に例を挙げます
server {
listen 80;
root /var/www/joomla;
index index.php index.html index.htm;
server_name www.domain.com;
location / {
try_files $uri $uri/ /index.php?q=$request_uri;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}