Thursday, January 13, 2022

[FIXED] .css and .js returns error 500 when called by HTML, but not when opened in new tab

Issue

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.


Solution

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.



Answered By - Mikhail

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.