I'm setting up a local Chevereto server (https://chevereto.com/free) for my Homework. After successfully downloaded the whole application, I run it with php -S localhost:8080. However it only shows plain HTML text without CSS and Javascript. I have no such problem when I set this up one month ago.
I have done some research on this and believe this is more of a browser problem. I set up a php script with a javascript in another file. When I run the script with php -S, the network tab show the request for the javascript file returned the index.php instead of the javascript. I am not sure if this is a similar problem though.
After I ran php -S and visit http://localhost:8080/ I open console and find this warning on:
<link rel="stylesheet" href="http://localhost:8080/lib/Peafowl/peafowl.css">
<link rel="stylesheet" href="http://localhost:8080/app/content/system/style.css">
With this warning:
Resource interpreted as Stylesheet but transferred with MIME type text/html: "http://localhost:8080/app/content/system/install".
Resource interpreted as Stylesheet but transferred with MIME type text/html: "http://localhost:8080/lib/Peafowl/install".
And this error:
Uncaught TypeError: $.each is not a function
at install:58
at install:58
While the source clearly has:
<script src="http://localhost:8080/lib/Peafowl/js/jquery.min.js"></script>
<script src="http://localhost:8080/lib/Peafowl/js/scripts.js"></script>
And those files exist on my computer.
While looking at the request for the CSS/Javascript files, I see this:
General:
Request URL: http://localhost:8080/lib/Peafowl/peafowl.js
Request Method: GET
Status Code: 301 Moved Permanently
Remote Address: [::1]:8080
Referrer Policy: no-referrer-when-downgrade
Response:
Cache-Control: no-store, no-cache, must-revalidate
Connection: close
Content-type: text/html; charset=utf-8
Date: Tue, 16 Apr 2019 09:40:44 +0000
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Host: localhost:8080
Location: http://localhost:8080/lib/Peafowl/install
Pragma: no-cache
X-Powered-By: PHP/7.1.25
Do anyone know how to fix it? Huge thanks.