PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Thursday, January 13, 2022

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

 January 13, 2022     apache, lamp, linux, php, ubuntu     No comments   

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
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

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

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing