我正在使用 DigitalOcean Debian 9 + PHP 7.0 + NGINX 1.10.3-1 并尝试安装 Joomla! CMS,但在第一个安装屏幕 (example.com/installation/index.php) 上,我注意到一个损坏的图像(这是 Joomla 徽标),它看起来像这样:
该图像的 img src 属性包含“/template/images/joomla.png”,但该图像实际上位于“/installation/template/images/joomla.png”,这意味着我缺少“/installation/”部分。
这是我的 PHP nginx 配置部分:
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
}
“/etc/php/7.0/fpm/php.ini”中的“cgi.fix_pathinfo”行未注释,值更改为 0。
“/snippets/fastcgi-php.conf”文件包含以下内容:
# regex to split $uri to $fastcgi_script_name and $fastcgi_path
fastcgi_split_path_info ^(.+\.php)(/.+)$;
# Check that the PHP script exists before passing it
try_files $fastcgi_script_name =404;
# Bypass the fact that try_files resets $fastcgi_path_info
# see: http://trac.nginx.org/nginx/ticket/321
set $path_info $fastcgi_path_info;
fastcgi_param PATH_INFO $path_info;
fastcgi_index index.php;
include fastcgi.conf;
我注意到,一旦我评论 PATH_INFO 部分,图像就会加载:
set $path_info $fastcgi_path_info;
fastcgi_param PATH_INFO $path_info;
但我所有进一步尝试找出问题根源的努力均未成功,请帮助我解决此问题。
我们的一位客户也遇到了同样的问题,我们解释了如何解决它这个帖子 http://www.itoctopus.com/all-urls-display-homepage-content-on-a-joomla-website-powered-by-nginx。本质上,你的try_files
线路不正确。
顺便说一句,cgi.fix_pathinfo
必须设置为 1,而不是零(默认为 0,因此取消注释并不能解决问题。)
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)