PHP – with Laragon!

Rare developer is the one who thrives on clutter – excess things, when one could suffice with less.

Try Laragon.

Especially if you want to get hands dirty quickly with development on a Windows laptop / PC. This is a real-world story of how I found the new fav toy! But what else? Find out.

Just as with alternatives, you get a Apache, PHP, MySQL stack with a single click. But Laragon is also a bit more:

  • looks nice
  • automagic virtual hosts: Laragon can update your HOSTS file
  • also Rails stack installed
  • seems to handle .dll dependencies well (I had trouble with alternatives)

Skip me if you know PHP

PHP is a versatile jack-of-all-trades. And it definitely holds its place with a firm grip. WordPress (blogging engine) and thousands of other well known apps are written in PHP. The power exists in a sturdy set of very central and useful built-in functions, which were chosen and developed by a real web admin for his own needs.

The true web pioneering technology

PHP evolved over the years. It had a very early start in 1994. PHP adopted very good ecosystem tools, such as linters, security checkers, and PHP was supported as a drop-in module in many kinds of web hosting environments. You could thus rely on the investment keeping its value.

I knew all this yet had barely written a few thousand lines of PHP in 2019. I felt that it was time to take mastery of PHP, even if I did it just at a rate of 20 minutes daily.

PHP sits at the server end. It can be written (sprinkled) within HTML, in separate files, or be made the “master of the universe” – with sole responsibility to take in HTTP requests and spit out all the other artefacts; HTML, Javascript code, images.

This is an important distinguishment to make. PHP interprets incoming web requests: GET, POST, HEAD, the usual stuff. This server side PHP code you’ve written takes care of routing these requests. Note here: You can write full web apps with PHP, but if you want to do hifi and have very elegant look-and-feel, it then also takes Javascript and CSS knowledge. So PHP’s role is to take care of classical server side processing; it can be used to do user interfaces, but on quite a rudimentary level. With today’s ‘flat design’ and minimalism, that might be ok. You don’t necessarily need top notch JS/CSS or any other frontend skills.

Peak to the neighbor: Node + Express

Node ecosystem has ‘express’ which is a light-weight development server. I’ll let the figures speak for themselves. Also, look at the setup of minimalist server-side code: couldn’t be easier?! The root ‘/’ is hooked to a anonymous function, that always returns the Hello world string. This is beautiful!

Idea across all of these is that whereas with Apache or nginx you usually handle more complicated real life dilemmas of web hosting; as developer you are interested in passing a single HTTP call, successively, to your code under development. You want button and menu item elements to fire action, and see what happens. As developer we’re more interested in the change of state of the app, as response to user input; rather than more complicated issues, kind of “..yet”. It helps to constrain the problem at hand to an understandable piece.

One thought on “PHP – with Laragon!

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s