外部文件不显示

c1s2d3n40 2018-02-05 04:08:17
thinkphp的网站,之前在iis7.5上没有问题,之后换成8.5就不行了, 在本地可以显示 。 所有 外部文件样式连接不上,显示”内部服务器错误“,图片也是这样。在网上查了半天没有思路。
...全文
2111 27 打赏 收藏 转发到动态 举报
写回复
用AI写文章
27 条回复
切换为时间正序
请发表友善的回复…
发表回复
c1s2d3n40 2018-02-23
  • 打赏
  • 举报
回复
引用 24 楼 xuzuning 的回复:
那总有 url重写的 设置吧?
有url重写,我查找了一下,没有跳转发现跳转Uploads/Picture这个路径或者public这个路径的
c1s2d3n40 2018-02-23
  • 打赏
  • 举报
回复
有url重写,我查找了一下,没有跳转发现跳转Uploads/Picture这个路径或者public这个路径的
xuzuning 2018-02-23
  • 打赏
  • 举报
回复
那总有 url重写的 设置吧?
c1s2d3n40 2018-02-23
  • 打赏
  • 举报
回复
引用 20 楼 xuzuning 的回复:
我让你检查 iis 的配置,你删 css和js文件 有何用?
<xmp>
<?php
$url = 'http://www.liuhangpeiyin.com';
print_r(get_headers($url));
/*

Array
(
    [0] => HTTP/1.1 200 OK
    [1] => Cache-Control: private
    [2] => Pragma: no-cache
    [3] => Content-Type: text/html; charset=utf-8
    [4] => Expires: Thu, 19 Nov 1981 08:52:00 GMT
    [5] => Server: Microsoft-IIS/8.5
    [6] => Set-Cookie: PHPSESSID=d864fe70hki04drrjg6qnrrr50; path=/
    [7] => X-Powered-By: ThinkPHP <= 既然你使用了 ThinkPHP,那么就一定会做 url重写配置,可能就是问题的原因
    [8] => X-Powered-By: ASP.NET
    [9] => Date: Fri, 09 Feb 2018 09:39:23 GMT
    [10] => Connection: close
    [11] => Content-Length: 68114
)
*/

$url = 'http://www.liuhangpeiyin.com/Uploads/Picture/2018-01-02/5a4afd1919a63.png';
print_r(get_headers($url));
/*
Array
(
    [0] => HTTP/1.1 500 Internal Server Error <= 500 服务器拒绝响应
    [1] => Content-Type: text/html
    [2] => Server: Microsoft-IIS/8.5
    [3] => Date: Fri, 09 Feb 2018 09:39:23 GMT
    [4] => Connection: close
    [5] => Content-Length: 57
)
*/

$url = 'http://www.liuhangpeiyin.com/Uploads/Picture';
print_r(get_headers($url));
/*
Array
(
    [0] => HTTP/1.1 301 Moved Permanently <= 这是 301 跳转
    [1] => Content-Type: text/html; charset=UTF-8
    [2] => Location: http://www.liuhangpeiyin.com/Uploads/Picture/ <= 跳转地址就是访问地址。
    [3] => Server: Microsoft-IIS/8.5
    [4] => X-Powered-By: ASP.NET
    [5] => Date: Fri, 09 Feb 2018 09:39:23 GMT
    [6] => Connection: close
    [7] => Content-Length: 168
    [8] => HTTP/1.1 500 Internal Server Error <= 跳转出现死循环,当然就是 500 错
    [9] => Content-Type: text/html
    [10] => Server: Microsoft-IIS/8.5
    [11] => Date: Fri, 09 Feb 2018 09:39:23 GMT
    [12] => Connection: close
    [13] => Content-Length: 57
)
*/
文件我基本上都找了一遍,没有找到重定向到Uploads/Picture这个文件路径的,iis还没有配置重定向,web.config这里没有重定向。我很愁
c1s2d3n40 2018-02-13
  • 打赏
  • 举报
回复
引用 20 楼 xuzuning 的回复:
我让你检查 iis 的配置,你删 css和js文件 有何用?
<xmp>
<?php
$url = 'http://www.liuhangpeiyin.com';
print_r(get_headers($url));
/*
Array
(
    [0] => HTTP/1.1 200 OK
    [1] => Cache-Control: private
    [2] => Pragma: no-cache
    [3] => Content-Type: text/html; charset=utf-8
    [4] => Expires: Thu, 19 Nov 1981 08:52:00 GMT
    [5] => Server: Microsoft-IIS/8.5
    [6] => Set-Cookie: PHPSESSID=d864fe70hki04drrjg6qnrrr50; path=/
    [7] => X-Powered-By: ThinkPHP <= 既然你使用了 ThinkPHP,那么就一定会做 url重写配置,可能就是问题的原因
    [8] => X-Powered-By: ASP.NET
    [9] => Date: Fri, 09 Feb 2018 09:39:23 GMT
    [10] => Connection: close
    [11] => Content-Length: 68114
)
*/

$url = 'http://www.liuhangpeiyin.com/Uploads/Picture/2018-01-02/5a4afd1919a63.png';
print_r(get_headers($url));
/*
Array
(
    [0] => HTTP/1.1 500 Internal Server Error <= 500 服务器拒绝响应
    [1] => Content-Type: text/html
    [2] => Server: Microsoft-IIS/8.5
    [3] => Date: Fri, 09 Feb 2018 09:39:23 GMT
    [4] => Connection: close
    [5] => Content-Length: 57
)
*/

$url = 'http://www.liuhangpeiyin.com/Uploads/Picture';
print_r(get_headers($url));
/*
Array
(
    [0] => HTTP/1.1 301 Moved Permanently <= 这是 301 跳转
    [1] => Content-Type: text/html; charset=UTF-8
    [2] => Location: http://www.liuhangpeiyin.com/Uploads/Picture/ <= 跳转地址就是访问地址。
    [3] => Server: Microsoft-IIS/8.5
    [4] => X-Powered-By: ASP.NET
    [5] => Date: Fri, 09 Feb 2018 09:39:23 GMT
    [6] => Connection: close
    [7] => Content-Length: 168
    [8] => HTTP/1.1 500 Internal Server Error <= 跳转出现死循环,当然就是 500 错
    [9] => Content-Type: text/html
    [10] => Server: Microsoft-IIS/8.5
    [11] => Date: Fri, 09 Feb 2018 09:39:23 GMT
    [12] => Connection: close
    [13] => Content-Length: 57
)
*/
懂了,受教了,谢谢,这家天有事没有及时的关注
xuzuning 2018-02-09
  • 打赏
  • 举报
回复
php.ini : display_errors = On 改后重启
xuzuning 2018-02-09
  • 打赏
  • 举报
回复
我让你检查 iis 的配置,你删 css和js文件 有何用?
<xmp>
<?php
$url = 'http://www.liuhangpeiyin.com';
print_r(get_headers($url));
/*
Array
(
    [0] => HTTP/1.1 200 OK
    [1] => Cache-Control: private
    [2] => Pragma: no-cache
    [3] => Content-Type: text/html; charset=utf-8
    [4] => Expires: Thu, 19 Nov 1981 08:52:00 GMT
    [5] => Server: Microsoft-IIS/8.5
    [6] => Set-Cookie: PHPSESSID=d864fe70hki04drrjg6qnrrr50; path=/
    [7] => X-Powered-By: ThinkPHP <= 既然你使用了 ThinkPHP,那么就一定会做 url重写配置,可能就是问题的原因
    [8] => X-Powered-By: ASP.NET
    [9] => Date: Fri, 09 Feb 2018 09:39:23 GMT
    [10] => Connection: close
    [11] => Content-Length: 68114
)
*/

$url = 'http://www.liuhangpeiyin.com/Uploads/Picture/2018-01-02/5a4afd1919a63.png';
print_r(get_headers($url));
/*
Array
(
    [0] => HTTP/1.1 500 Internal Server Error <= 500 服务器拒绝响应
    [1] => Content-Type: text/html
    [2] => Server: Microsoft-IIS/8.5
    [3] => Date: Fri, 09 Feb 2018 09:39:23 GMT
    [4] => Connection: close
    [5] => Content-Length: 57
)
*/

$url = 'http://www.liuhangpeiyin.com/Uploads/Picture';
print_r(get_headers($url));
/*
Array
(
    [0] => HTTP/1.1 301 Moved Permanently <= 这是 301 跳转
    [1] => Content-Type: text/html; charset=UTF-8
    [2] => Location: http://www.liuhangpeiyin.com/Uploads/Picture/ <= 跳转地址就是访问地址。
    [3] => Server: Microsoft-IIS/8.5
    [4] => X-Powered-By: ASP.NET
    [5] => Date: Fri, 09 Feb 2018 09:39:23 GMT
    [6] => Connection: close
    [7] => Content-Length: 168
    [8] => HTTP/1.1 500 Internal Server Error <= 跳转出现死循环,当然就是 500 错
    [9] => Content-Type: text/html
    [10] => Server: Microsoft-IIS/8.5
    [11] => Date: Fri, 09 Feb 2018 09:39:23 GMT
    [12] => Connection: close
    [13] => Content-Length: 57
)
*/
xuzuning 2018-02-09
  • 打赏
  • 举报
回复
编程不是搭积木,没点智商是不行的 您见过哪个成年人自己搭积木玩的吗?
c1s2d3n40 2018-02-09
  • 打赏
  • 举报
回复
刚刚想到还有之前上通过本地后台上传的图片,但是url拼接以后发现还是打不开。http://www.liuhangpeiyin.com/Uploads/Picture/2018-01-02/5a4afd1919a63.png
c1s2d3n40 2018-02-09
  • 打赏
  • 举报
回复
引用 14 楼 xuzuning 的回复:
301 跳转不会自己产生,一定是有配置文件让他跳的,但跳转的目标是自身的话,这就产生了死循环。当然服务器就报 500 错了
所以你的先去查清是哪里配置了 301 跳转
我已经把所有的css和js文件全部清除了,只剩下img了,但是拼接路径还是打不开啊?
xuzuning 2018-02-09
  • 打赏
  • 举报
回复
其实如果你早一点给出网站地址,可能问题早就解决了,至少不至于到现在还一筹莫展
c1s2d3n40 2018-02-09
  • 打赏
  • 举报
回复
引用 14 楼 xuzuning 的回复:
301 跳转不会自己产生,一定是有配置文件让他跳的,但跳转的目标是自身的话,这就产生了死循环。当然服务器就报 500 错了 所以你的先去查清是哪里配置了 301 跳转
好的,谢谢了
智商众筹 2018-02-09
  • 打赏
  • 举报
回复
路过推荐一下linux服务器和docker技术
xuzuning 2018-02-09
  • 打赏
  • 举报
回复
301 跳转不会自己产生,一定是有配置文件让他跳的,但跳转的目标是自身的话,这就产生了死循环。当然服务器就报 500 错了 所以你的先去查清是哪里配置了 301 跳转
c1s2d3n40 2018-02-09
  • 打赏
  • 举报
回复
引用 11 楼 xuzuning 的回复:
访问 liuhangpeiyin.com/Public/static/peiyin/cee/custom-ui.css 显示:无法显示页面,因为发生内部服务器错误。 访问 http://liuhangpeiyin.com/ 图片和样式表路径错误 探测 http://liuhangpeiyin.com/Public 及下级 有一个 301 跳转到自身,跳转后 500 错 估计是 Public 下存在一个错误的配置文件
这个是不是不能具体到文件夹啊,这个public里面的文件夹有点多
c1s2d3n40 2018-02-09
  • 打赏
  • 举报
回复
引用 11 楼 xuzuning 的回复:
访问 liuhangpeiyin.com/Public/static/peiyin/cee/custom-ui.css 显示:无法显示页面,因为发生内部服务器错误。 访问 http://liuhangpeiyin.com/ 图片和样式表路径错误 探测 http://liuhangpeiyin.com/Public 及下级 有一个 301 跳转到自身,跳转后 500 错 估计是 Public 下存在一个错误的配置文件
谢谢了,我看看,但是为什么iis7.5就没有问题啊,iis8.5就不行了
xuzuning 2018-02-09
  • 打赏
  • 举报
回复
访问 liuhangpeiyin.com/Public/static/peiyin/cee/custom-ui.css 显示:无法显示页面,因为发生内部服务器错误。 访问 http://liuhangpeiyin.com/ 图片和样式表路径错误 探测 http://liuhangpeiyin.com/Public 及下级 有一个 301 跳转到自身,跳转后 500 错 估计是 Public 下存在一个错误的配置文件
c1s2d3n40 2018-02-09
  • 打赏
  • 举报
回复
引用 2 楼 xuzuning 的回复:
打开php的错误显示功能,就可直到问题出在哪里
你现在的 500 不能提供有价值的信息

输入单独的文件路径无法打开网页,只显示这个
转义之后是:“内部服务器错误” ,也在网上找了好多,但是这段乱码就是没法去除,url打开图片也是是上面的那段乱码
c1s2d3n40 2018-02-09
  • 打赏
  • 举报
回复
引用 8 楼 xuzuning 的回复:
php.ini :
display_errors = On
改后重启

这个已经设置了
c1s2d3n40 2018-02-08
  • 打赏
  • 举报
回复
引用 5 楼 u013753050 的回复:
这个一般是路劲问题,或者权限问题,
我把文件路径拼接上在服务器也是不显示,调试了半天都没有把500错误详情弄出来
加载更多回复(6)

21,886

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧