Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP Build a Simple PHP Application Creating the Menu and Footer Starting the Project

External css file and Ubuntu conflict!

So... Hell-o!

As I've written, I'm using the newest Ubuntu and my problem is quite... Stupid probably (I'm new to Linux, but I know that most of webservers use it).

What's more - I'm using htdocs folder to keep all these; So htdocs is my root folder (where the main index.php is being kept), so this path looks good to me, but... As I said before - I'm new to Linux, just a beginner.

So, I've got my href link to external css file, just like: "css/style.css", and... It doesn't work. It works only when I put style.css into the same folder in which I've got my index.php.

I tried to use ./css/style.css, some variants with echo but noone of those work, so... Please, help me.

Thanks in advance! :)

Oh, yeah. I've almost forgotten!

It looks like my .php do not see a .css of mine by this path. I've got XAMPP and PHP5 installed. Is it a problem of a path or something bigger?

As a text editor I'm using Geany.

Hugo Paz
Hugo Paz
15,622 Points

Christopher,

Could you please post your folder structure and your index.php code.

Oh, right. Sorry.

Here comes the code of my index.php -> http://pastebin.com/iVXwUWrH

And here is a screenshot of my folder and it's path -> http://imageshack.com/a/img913/4288/4VCBrw.png

Maybe it's something connected with permission of these folders or style.css itself?

Hugo Paz
Hugo Paz
15,622 Points

Can you check the css folder permissions?

Indeed.

For css folder it is "drwx------" , group and a user are names of mine admin account.

Oh... It works :D.

Thank you so much! I really appreciate your help, you're great! :)

Hugo, you're awesome as always!

Christopher, it is awesome you are using Ubuntu! I use Kubuntu myself and love it so much.

4 Answers

Hugo Paz
Hugo Paz
15,622 Points

That seems to be the issue, apache cannot read or execute the folder. You can see what you need to do here

Fabian Wilson
Fabian Wilson
5,076 Points

Hard to tell what the problem is from your post. Can you post your index.php file so we see what the issue maybe.

Fabian Wilson
Fabian Wilson
5,076 Points

I don't think your problem is related to unbuntu sine I've uses it many times without issue. My guess is a syntax problem. I think "/css/style.css" should work.

It doesn't work for some reason. I tried to add it even via php itself, but... Still nothing.

Oh, right. Sorry.

Here comes the code of my index.php -> http://pastebin.com/iVXwUWrH

And here is a screenshot of my folder and it's path -> http://imageshack.com/a/img913/4288/4VCBrw.png

Maybe it's something connected with permission of these folders or style.css itself?