Ask HN: What's your PHP development environment setup?

8 points by leeshire ↗ HN
I got a Lenovo IdeaPad as a gift S340

I'm wondering if it's wroth installing Linux Ubuntu on on my Lenovo or just keeping my Windows 10 and learn PHP on windows?

What would you recommend? what are some of your setups so I can get some ideas.

It seems like is hard to install PHP Dev Env on Windows 10 it keeps asking to install redistributable.

I think MacBook was the best laptop I had because you can just install MAMP.

13 comments

[ 3.4 ms ] story [ 47.7 ms ] thread
Linux + VS Code + Docker Compose + PHP in container + source mounted

OS: Pop_OS, Regolith, Manjaro, Ubuntu

Invest time in learning Linux basis, you will be positively surprised.

Don't use MAMP.

Use whatever OS you like in terms of UI. If you enjoy MacOS, use it.

Run PHP in a container that matches your servers and has declarative infrastructure (Docker Compose, Vagrant, Ansible, Pulumi, whatever). All have boilerplate PHP configs you can download.

Then use PhpStorm. VS Code is free but not even in the ballpark in terms of static analysis, refactoring, linting, and autocomplete.

I use PHP-Storm + Vagrant on Windows 10. There are plenty of pre-packaged Vagrant Boxes for this use case like VCCW [1] or Homestead [2]. Setup only takes a few minutes and you can keep your Windows 10 while using Ubuntu to run your PHP code.

[1] http://vccw.cc/ [2] https://laravel.com/docs/7.x/homestead

XAMPP [1] provides a fairly complete dev environment with a basic web sever and DB. Do this if you find using Docker an overkill for your project.

Bonus point, they have good integrations with AWS and GCP.

[1] https://www.apachefriends.org/fr/index.html

Im on MacOS

I use PHPStorm for my IDE, but sometimes I try VS Code before I give up and remember why I dont use it.

I use the Homestead Vagrant box from Laravel since my dev work is Laravel.

Linux Mint - was using Ubuntu but it isn't always up to date on PHP/MySQL versions.

IDE - Eclipse/PHP

Never been a fan of Windows' inconveniences, and Apple is notoriously fickle on Unix support, timeliness, versions, and patches.

Don't do weird setup on Windows or Mac locally.

Just get a native Linux through virtualization like VirtualBox or VMware or WSL (maybe wait for WSL2) and run Ubuntu in it. You'll find it makes sense when you want to deploy stuff on the cloud on Ubuntu with mostly identical environment.

Debian stable, Eclipse PDT, PHP 7.4 and Xdebug compiled from source.
iMac

All environment are setup using docker compose

PhpStorm & macVi

Search Results

Web result with site links

Sequel Pro for mysql management

You can use docker, so the OS doesn't matter and you don't need to install a webserver, php, mysql and other things on your main system. Even if you use Ubuntu as your main system it's good idea to use docker for you local environment.

If you need a starting point I have a example on GitHub that may help you: https://github.com/bhdzllr/localhost/tree/master/docker-lemp

It's a LEMP stack. You need to change the volumes in the "docker-compose.yaml" to match to your system and adapt and copy the "nginx/default.conf" into the volume path of nginx. The "nginx/default.conf" has some examples which you may delete.