PHP versions
Butler can run several PHP versions side by side. You set one as the global default and override it per project whenever you need to.
Set the global default
Section titled “Set the global default”butler use 8.3Every site that hasn’t pinned its own version uses this one. You can also set the global version from the PHP section of the menu bar app.
Install another version
Section titled “Install another version”If a version isn’t installed yet, add it:
butler install php@8.4Installed versions appear in the app’s PHP section, where you can switch the default or install more with a click.
Pin a version to one site
Section titled “Pin a version to one site”To run a single project on a different PHP version without changing your global
default, run butler isolate from the project directory:
cd ~/Sites/my-appbutler isolate 8.2Or target a site by name with --site from anywhere:
butler isolate 8.2 --site my-appNow my-app.test uses PHP 8.2 while everything else stays on the default. Undo it
with butler unisolate (also auto-detects from the current directory, or takes a
site name):
butler unisolate my-appYou can also pin the version in the project’s
butler.yml, which is handy because it travels
with the repo:
php: "8.2"Run PHP and Composer
Section titled “Run PHP and Composer”butler php runs the active PHP for the current directory — the isolated
version if the folder is a site with one pinned, otherwise your global default:
butler php -vbutler php artisan migratebutler composer runs Composer through that same PHP, so your dependencies are
resolved against the version the site actually uses:
butler composer installbutler composer require laravel/pint --devThis means you don’t have to juggle a system PHP or remember which version is on
your PATH — Butler always uses the right one for where you are.
Tuning php.ini
Section titled “Tuning php.ini”Butler ships each PHP version with an ini tuned for real frameworks (sensible
memory limits, OPcache settings and so on). If you’ve edited a version’s php.ini
and want to get back to Butler’s defaults, reset it from the PHP section of
the app. Per-site PHP settings can also be set in
butler.yml:
server: phpSettings: memory_limit: "1G"