Link to home
Create AccountLog in
Avatar of curiouswebster
curiouswebsterFlag for United States of America

asked on

PHP: How to configure a PHP localhost Dev Environment on Windows 10?

I need to create a PHP Dev Environment, running on localhost, hosted in Windows 10.

What steps are there which I need to follow?

I assume I would use Visual Studio Code. What Extensions do I need to VSCode to be my PHP Dev tool? 

Thanks
ASKER CERTIFIED SOLUTION
Avatar of Cyril Joudieh
Cyril Joudieh
Flag of Lebanon image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of curiouswebster

ASKER

Thanks. Is there any risk to just installing WAMP server?

Once I get those installed, I will see how far I get and post any questions here...
SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
I do plan to set up a dev site adjacent to my production site. But, I assumed that such a site would not be so easy for me to get instance access to changes, like I can when running from localhost. And, I do want to have localhost development in the event I have no Internet access.

So, localhost seems much easier on Windows than a Mac, so I am okay using WAMP Server, if that lets me develop in Windows with no Internet access. Then, I can do periodic tests on my dev site, adjacent to my production site.

Make sense?
SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
A Local environment really is a fundamental part of the development stack.

Generally speaking, if you want to have a particularly robust system, you'll likely have 3 environments - Local, Staging and Production.

Local is where you'll do the majority of your coding and testing. It's integrated with your IDE of choice, and allows you to run full test / debug sessions. It's where you'll install all of your Project's development dependencies. It's where you'll build your app. Periodically, you'll push your app to Staging for 'live' testing, previews etc, and from there, you'll push to Production..

How you set up that Local environment may well depend on your own needs and workflow. The WAMP Server route is a really quick and easy way to get up and running - effectively a one-click install and you're good to go. If your development is relatively straight-forward, then you may develop using that for years to come. The ease of WAMPServer does however sacrifice some flexibility.

A much more flexible and powerful setup is to use the built-in Windows Subsystem for Linux (WSL) and/or Docker. This allows you to set up a fully-functioning, isolated Linux development platform right on your Windows PC. Your IDE (VSCode!) interacts directly with the subsystem and you can easily swap out various parts of the stack (different versions of PHP for example).

It's a little more complicated to setup, but once done - it's really powerful. If you also install Git into the system, pushing from local to staging can be a simple as a one-line command :)
Visual Studio Code makes Git very easy. There are also extensions to visually make data easier if you work with JSON, CSV, ... Visual Studio Code usually prompts you for extensions based on how you use it.