DEV Community

Cover image for Forget XAMPP! Create a dev environment | Part 1 | Install PHP
Horváth Gergely
Horváth Gergely

Posted on

2

Forget XAMPP! Create a dev environment | Part 1 | Install PHP

It's easy right? Just pushing your stuff into a directory somewhere on your pc then accessing it from a url?

Well yeah, then you want to deploy your project into production and it breaks because of the url rules you had to set up in order to be able to work on it.

In this article i will show you how i do it after 2 years ( and i still have much to learn )

Prerequisities

You need some kind of package manager first. If you're on linux you're safe. Just

$ sudo apt-get install php7.3
Enter fullscreen mode Exit fullscreen mode

But most of you reading this article for better practices aren't using linux. If you were, you wouldn't need this I'm sure. So, here you go then, package manager for Windows.

Windows

Wait what? Is there a package manager for Windows?

Well duh, ofc you dumbass. If you did not heard about it, you may've been sleeping under a rock or i dunno.

You can find everything here: https://chocolatey.org/install

Then it's just a matter of

choco install php --version 7.3
Enter fullscreen mode Exit fullscreen mode

This command. You will find the php runtime library after the installation at "X:\tools\php". Since choco will adjust your environmental variables, you don't need to do anything after this, just reopen your terminal and enter:

Please note that you may have to restart your terminal to make the changes take effect ( if you are using cmd or powershell )

php -v
Enter fullscreen mode Exit fullscreen mode

If you've done everything right, you should see the php version and the build number and some other weird stuff you may don't really understand yet. 😄

Mac OS

Homebrew. Did you heard about it? You will need it.
It's quite essential for a Mac if you're a developer.

Here, follow this link and install: https://brew.sh/

If everything went smooth you should be able to install the php runtime library by entering this:

$ brew install php@7.3
Enter fullscreen mode Exit fullscreen mode

You can find Part 2 here:

💡 One last tip before you go

Tired of spending so much on your side projects? 🤔

We have created a membership program that helps cap your costs so you can build and experiment for less. And we currently have early-bird pricing which makes it an even better value! 🐥

Check out DEV++

Top comments (0)

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more

👋 Kindness is contagious

Immerse yourself in a wealth of knowledge with this piece, supported by the inclusive DEV Community—every developer, no matter where they are in their journey, is invited to contribute to our collective wisdom.

A simple “thank you” goes a long way—express your gratitude below in the comments!

Gathering insights enriches our journey on DEV and fortifies our community ties. Did you find this article valuable? Taking a moment to thank the author can have a significant impact.

Okay