.css 和 .js 在由 HTML 调用时返回错误 500,但在新选项卡中打开时不会返回错误
HTML(即 标记或
如果我在 - 中打开所述文件,我会正确地看到内容。当我查看源代码时,我可以右键单击 URL 以确保没有拼写错误。
刷新页面不会向 /var/log/apache2/error.log 添加新行
Ubuntu 10.04 - 32 位
HTML 示例:
<style type="text/css">
@import '/css/main.css';
a em, button em {font-style:normal; text-decoration:underline;}
</style>
<link type="text/css" rel="stylesheet" href="/floatbox/floatbox.css" />
<script type="text/javascript" src="/floatbox/floatbox.js"></script>
找到一些原因:
与 javascript 的问题无关——那完全是我的错。
对于 .css,我也使用 PHP 解析这些文件。这是通过以下行完成的:
AddType application/x-httpd-php .php .css
我尝试将其更改为
AddHandler application/x-httpd-php .php .css
但没有成功 - 如果上面两行中的任一存在,那么我会收到错误 500。
No files that are requested by the HTML (i.e. <link>
tag, or <script src=...
tag) work. Every time they return error 500 regardless of the browser.
If I open the said file in a - I see the contents correctly. I can right click the URL when I do View Source to make sure there's no typo.
Refreshing the page does not add new lines to /var/log/apache2/error.log
Ubuntu 10.04 - 32bit
Example of HTML:
<style type="text/css">
@import '/css/main.css';
a em, button em {font-style:normal; text-decoration:underline;}
</style>
<link type="text/css" rel="stylesheet" href="/floatbox/floatbox.css" />
<script type="text/javascript" src="/floatbox/floatbox.js"></script>
Found some cause:
Issues with javascript were unrelated -- that was my fault entirely.
For .css I parse those files using PHP also. This was done by the following line:
AddType application/x-httpd-php .php .css
I tried changing it to
AddHandler application/x-httpd-php .php .css
But with no success -- if either one of the two lines above is present, then I get Error 500.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不幸的是,这不是社区可以解决的问题。触发错误 500 是因为我从注册的关闭函数中调用了 xdebug 函数,但没有正确加载 xdebug 模块。
Unfortunately this is not something that could have been solved by the community. The error 500 was triggered because I had called an xdebug function from a registered shutdown function but I did not have xdebug module loaded correctly.