我将 joomla web 文件夹从 ubuntu 14.04 复制到同一目录到 ubuntu 16.04 服务器。
所有设置不变。
在确保 vhost fastcgi 指向 php7.0-fpm.sock 而不是 ubuntu 16.04 上的 php5.-fpm.sock 后,它只显示空白屏幕。
在访问日志上:
192.168.1.10 - - [19/Jul/2016:11:09:45 +0800] "GET / HTTP/1.1" 500 5 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:42.0) Gecko/20100101 Firefox/42.0"
/etc/nginx/nginx.conf
user www-data;
worker_processes auto;
pid /run/nginx.pid;
events {
worker_connections 100;
multi_accept on;
use epoll;
}
http {
client_max_body_size 200M;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
keepalive_requests 200;
types_hash_max_size 2048;
server_names_hash_max_size 1024;
server_names_hash_bucket_size 128;
server_tokens off;
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log off;
error_log /var/log/nginx/error.log;
open_file_cache max=600000 inactive=20s;
open_file_cache_valid 60s;
open_file_cache_min_uses 2;
open_file_cache_errors on;
gzip on;
gzip_vary on;
gzip_min_length 256;
gzip_comp_level 3;
gzip_proxied expired no-cache no-store private auth;
gzip_types text/css text/xml text/javascript application/x-javascript application/xml;
gzip_disable "MSIE [1-6]\.";
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
fastcgi_buffer_size 128k;
fastcgi_buffers 256 16k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
fastcgi_connect_timeout 30;
fastcgi_send_timeout 25;
fastcgi_read_timeout 20;
}
/etc/nginx/sites-enabled/mydomain
server {
listen 80;
root /var/www/;
index index.php index.html index.htm;
server_name www.mydomain.com;
location / {
try_files $uri $uri/ /index.php?q=$request_uri;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}
以前(ubuntu 14,04, php5, nginx 1.4),是因为不包括fastcgi_index,包括fastcgi_params,这次不包括(ubuntu 16.04, php7, nginx 1.10)。即使删除这些设置也不能解决这个问题。
可能与 PHP 7 不兼容。您可以按照本指南从系统中清除 PHP 7 并安装 PHP 5.6。这可能会解决您的问题,但我认为 Joomla 3.5 支持 PHP 7。您是否使用不支持 PHP 7 的旧版 Joomla?您可以同时尝试一下,看看它是否能解决您的问题,或者下载最新版本的 Joomla。
在 Xenial (16.04) 上安装 PHP 5.6