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 Building Websites with PHP Contact Form & Sending Email Named Routes

Sam Deacon
Sam Deacon
2,650 Points

Is it advisable to build-test php projects on a local linux setup?

is it best to build / test on a 'local' linux distro?

Appreciate the idea is to keep it simple at this stage of learning, however I guess the other side of things is designing-building->deploying to a different OS environment (apache on linux as most web hosts) which may be structured differently?

i suppose using cloud 9 (sorta ubuntu project environment - which i currently use) isn't going to cut it? (and test deploying to something like heroku would be too time consuming).

I can't dual boot my (family) laptop, I'm considering just buying another cheap one and make a few linux partititions.

Then theres vagrant / docker. hmmmmm

@Ted Sumner

1 Answer

is it best to build / test on a 'local' linux distro?

Questions like this will inevitably lead to a debate about which system is better to develop on but usually the answer comes down to develop on whichever system is preferable to you.

If you are buying a second laptop you could just dump the windows os and go outright for ubuntu, which is open source and a decent linux distro, whilst also staying quite close to windows in regards to general interaction.

If you dont want to do this you can always install something like xamp which will provide you with an apache environment on your machine.

Regardless of what you decide to do most of the coding that you do on this course, it seems, will not be affected by which deployment environment you choose.

Sam Deacon
Sam Deacon
2,650 Points

Thankyou Carlos Yeah I wasn't Interested in a OS-war, just objectively addressing things like install paths / route directories etc

Basically if I went the windows/WAMP route and built (example a php app with laravel and composer packages), and routing, email etc etc.... Would I face problems getting it running in the same way when it comes to deploy to a linux webhost?

Sam,

I think building it in the closest environment to what you are deploying it will cause the least problems. Most of the code in an app like this will transfer over no problem. Its just straight up php. Where there might be issues is with composer and having access to a console, depending on your deployment environment. A lot of places provide something like c-panel access which gives you the basics but not much else. Ideally you only need to transfer your project files and then allow composer to install the dependencies online but if you dont have access you can just transfer all the dependencies aswell.

The other thing is that there will probably always be some issues when moving from a development environment to a production one.