Good people, I'm making a very simple page, to return to programming.
Here's the problem: my php is not loading Css, Img, or Js.
Yes, I've tried to put the absolute / relative path
My directories:
- public /
- css
- js
- src /
- header.php
- index.php
I happen to run your "php -s -s localhost: 8000 index.php" and try to access the website, it will load the normal page, however without any css and no js.
In my "index.php" an include of the "header.php" occurs, including the css is inserted through the html tag:
<link rel="stylesheet" type="text/css" href="/public/css.css" />
I've tried it too:
<link rel="stylesheet" type="text/css" href="../public/css.css" />
I also tried ridiculous things like putting any path to see if it gave:
<link rel="stylesheet" type="text/css" href="css.css" />
I've also tried the relative:
<link rel="stylesheet" type="text/css" href="public/css.css" />
I've tried several things, the relative path does not work either. Anyway, I've been searching for a couple of days on the internet and nothing. In every forum is said to use the absolute path, but I have used it and nothing.
In the terminal, this message appears:
PHP 7.0.19-1 + deb.sury.org ~ xenial + 1 Development Server started at Sat May 13 17:14:49 2017
[Sat May 13 16:49:06 2017] 127.0.0.1:51976 Invalid request (Unexpected EOF)
I reinstalled php, apache2, and everything else
Use or Ubuntu 16.04 LTS
It worked with a GIANT gambiarra here folks ...
I did something with the slim, to try to put a friendly URL, hence I made a route only to a css (As if it were a url for a page, but for the .css).
For example, the route "/ meucss" renders the file "meucss.css" just like a page itself.
In the HTML tag to pull the css from there I only put href="/ meucss" and it loads the css ... But does not apply the stilo, just load
However, I have no conditions, so I have to keep putting routes for each css / img / js that I want to insert into the page ... Does anyone have a tip?
Thanks!