Skip to content
On this page

Local environment

Forme should play nicely with local PHP development environments like Valet, Mamp, Local, or your own installation.

The Forme codegen also provides ketch, a selection of useful cli commands to spin up a basic zero config docker environment.

You could also run your local dev in a Vagrant virtual machine - we won't be covering that use case for now, but you should be able to get a steer from the local setup and remote deployment instructions.

tldr;

You need:

  • bash (or zsh/fish etc but see below)
  • git 2.x
  • php 8.3 or higher
  • composer 2.x
  • node 18.x lts/hydrogen or higher plus associated npm version
  • mysql 5.7+ (unless you're using docker/ketch)
  • a local web server (unless you're using docker/ketch)
  • forme codegen
  • wget, curl, wp cli, git cliff, psysh, phpstan

You probably want:

  • a system package manager like Homebrew

Bash

Many of the commands in these docs assume a working bash shell.

Newer versions of OS X have zsh as default rather than bash. They should be mostly compatible but there are a few differences, and we haven't tested our shell scripts with zsh. Even where OS X does have bash, it's often an old version which might be missing a few features.

You can install the latest version with Homebrew:

bash
brew install bash
micro /etc/shells # Or edit with your favourite terminal editor

# add to last line
/usr/local/bin/bash

chsh -s /usr/local/bin/bash $USER # this will set for the current user.

# Quit terminal and restart
bash --version

Git

You should be running version 2.x of git. You most likely have this already if you do any development.

PHP

You should be running PHP 8.3 or higher on both server and command line. You should have php already if you've got a local development environment, but you need to make sure the right version is available in your terminal.

Composer

You'll need the latest version of composer 2.x available globally on the command line.

Composer is the defacto package manager for php libraries.

Node

You should also have node and npm available globally to use the code generation tool, preferably lts version 18.x aka hydrogen (others might work too, but we've never tested anything below 12/erbium). If you use nvm (which you should!) then you'll need to do something like:

bash
nvm use lts/hydrogen

MySQL

Setting up MySQL is out of scope for these docs, but you should have that as part of whatever local development environment system you use.

A Local Web Server

Setting up your local web server is out of scope for these docs, but similarly to MySQL, Apache and/or Nginx should form part of whatever local development environment system you are using. You might also have HTTPs configured via DNSMasq or Acrylic.

Forme Codegen

Read more about that here!

Other development packages

We also recommend getting the following installed globally on your machine if they aren't already, since various codegen cli commands, as well as examples in these docs rely on them.

Made by Moussa Clarke @ Sanders Web Works with ❤️