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 trialChristopher Bernat
4,807 PointsExternal 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! :)
Hugo Paz
15,622 PointsChristopher,
Could you please post your folder structure and your index.php code.
Christopher Bernat
4,807 PointsOh, 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
15,622 PointsCan you check the css folder permissions?
Christopher Bernat
4,807 PointsIndeed.
For css folder it is "drwx------" , group and a user are names of mine admin account.
Christopher Bernat
4,807 PointsOh... It works :D.
Thank you so much! I really appreciate your help, you're great! :)
Marcus Parsons
15,719 PointsHugo, 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
15,622 PointsThat seems to be the issue, apache cannot read or execute the folder. You can see what you need to do here
Fabian Wilson
5,076 PointsHard 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
5,076 PointsI 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.
Christopher Bernat
4,807 PointsIt doesn't work for some reason. I tried to add it even via php itself, but... Still nothing.
Christopher Bernat
4,807 PointsOh, 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?
Christopher Bernat
4,807 PointsChristopher Bernat
4,807 PointsOh, 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.