What is your local development environment?

Following the new local development environment cookbook recipe, I am wondering who uses what.

  • MAMP or MAMP Pro
  • XAMPP
  • WAMP
  • PHP’s built-in server
  • Laravel Valet
  • Valet+
  • Vagrant + Virtual Box
  • Laravel Homestead

0 voters

2 Likes

Laragon!

1 Like

@moeli Looks good, Windows only it seems? Might add it to the recipe.

Yes, I think it is only available for windows at the moment (and no plans to bring it to other OS)

using laragon for about 2 years or so.

I use a local environment based on this tutorial. It’s written for Mac, but a few substitutions will let you spin it up in Linux.

Linux + Caddy server + PHP-FPM

I’m wondering nobody mentioned …

Docker + PHP-FPM & NGINX directly

2 Likes

My development environment you can find at HowTo: Start Kirby development on a PC, only the versions are now newer like a Win10 64bit laptop and the XAMPP version 64bit.

any chance you can share your docker file with us?

I use docker. Pretty much just copy/paste this docker-compose file into every new project which gives me a PHP/Apache server and an SMTP server for testing emails in a single command: docker-compose up

version: "3"

services:
  server:
    image: webdevops/php-apache-dev:7.2
    volumes:
      - ./site:/app
    ports:
      - "8080:80"

  maildev:
    image: djfarrelly/maildev

    ports:
      - "1080:80"
      - "1025:25"

I usually also run browser-sync.

browser-sync start --proxy localhost:8080 --files site/**/*

I’ve found this is a nice balance between simplicity and power. I don’t usually deal with grunt/gulp/webpack/sass/etc. Just a single hand written CSS file. Anything up to around 1,500 lines is pretty easy to maintain and sidesteps tons of unneeded complexity.

1 Like

Also, I deploy with Git. Just run a “git init --bare” on the server and add this as a post-receive hook in the hooks directory:

#!/bin/sh

git --work-tree=/home/public checkout -f

Add a remote to my local git repo

git remote add webhost ssh://user:password@remotehost.com/home/private/website_repo

Then deployment is a simple

git push webhost master

Minimum configuration and complexity, maximum flexibility. :slight_smile:

@Jayshua Thanks for sharing your configuration.

It is the Kirby-Docker-Starter by @S1SYPHOS, you will find it in the Forum als well as on Github!

I have a (local) docker image on linux, whose run command I have aliased to apache.
This allows me to go into any directory and type “apache” in the console to start an ephemeral container running php on apache, bound on 0.0.0.0:80 with the current directory as webroot.

the image looks like this

FROM php:7-apache

RUN apt-get update && apt-get install -y \
    libfreetype6-dev \
    libjpeg62-turbo-dev \
    libpng-dev \
    libzip-dev

RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
    && docker-php-ext-install gd iconv exif mbstring zip pdo_mysql gettext

RUN export CFLAGS="$PHP_CFLAGS" CPPFLAGS="$PHP_CPPFLAGS" LDFLAGS="$PHP_LDFLAGS" \
    && apt-get install -y --no-install-recommends \
    libmagickwand-dev \
    && rm -rf /var/lib/apt/lists/* \
    && pecl install imagick-3.4.3 \
    && docker-php-ext-enable imagick

RUN a2enmod rewrite
RUN usermod -u 2000 www-data

(my user id is 2000)

the alias looks like this:

alias apache='docker run --rm -p 80:80 -v "$PWD:/var/www/html" myimagename'

+1 for docker-compose + browsersync!

I also still use gulp to minify images, run postcss plugins, fingerprint assets…

I know the kirby core team moved (far far) away from the built in php server, but for the sake of speed and ease of use, I only use the builtin php server for kirby projects.
(Unless a very specific server configuration is required, in which case I use VMs).

The switching of php versions is handled via brew-php-switcher brew package.

To speed things up, I made a simple (hackable) script that allows me to install kirby, uninstall, compile js and css and watch changes easily with a simple level of debug. It’s as simple as:

make install
make dev
...
make stop

Needs git, global node and sass.
Works on OsX, should work on linux — windows via WSL ?
Here it is: https://github.com/tasinttttttt/bootstrap-kirby

Curious to know if anyone else would use this :smiley:

Is there any chance of adding EasyPHP to document? @texnixe

Thats pretty neat but very opinionated. You can do most of that stuff NPM scripts anyway, without using make.

I find Valet a good alternative to having such a lightweight server. You get Mix thrown in for free so that takes care of SASS, and Javascript compilation.

I’ve wanted to switch my local dev environment on windows 10 and Windows Subsystem for Linux for a while. I found this handy guide that explains almost everything:

And I now have a Valet environment on Windows 10 and Kirby is running perfectly. I highly recommend it!

1 Like