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 trialBrian Patterson
19,588 PointsGeneral question about php.
I have a general question about renaming the html file to php. I have been working on a single page application and wanted to know if this translates well into this project. When I click on the html file the file opens in the browser fine. When I change the extension to php the format of the site gets moved all to the left hand side. Is there anything I can do to this. Basically I feel the best way to learn is to create your own project and I am scratching my head as to example I could use.
3 Answers
Seth Kroger
56,414 PointsWhen working with PHP on your local machine you need to have PHP installed and configured to use on your web server (as well as a web server that supports PHP installed locally). PHP Workspaces do that for you automatically so you don't have to worry about it. Depending on your OS there are bundled solutions called WAMP/MAMP/LAMP (for Windows, Mac and Linux respectively) what will install Apache server, PHP, and MySQL for database.
Brian Patterson
19,588 PointsI was using MAMP.
Seth Kroger
56,414 PointsIn DevTools are there any 404's when loading the page (like a misplaced CSS file)?
Brian Patterson
19,588 PointsI will have a look.
Brian Patterson
19,588 Points<html>
<head>
<meta charset="utf-8">
<title><?php echo "Donna Couch | Aquastars"; ?></title>
<!-- <link rel="stylesheet" href="css/normalize.css"> -->
<link href="https://fonts.googleapis.com/css?family=Changa+One|Open+Sans" rel="stylesheet">
<link rel="stylesheet" href="css/style.css">
</head>
The above is in head but the style sheet does not seem to load.
Brian Patterson
19,588 PointsBrian Patterson
19,588 PointsJust an aside- I added the same code into workspaces and it works. Why is work spaces different to my local machine?