Skip to content

Commit 4a829ff

Browse files
More clarity for using with MAMP
1 parent b5ef868 commit 4a829ff

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

docs/installing/index.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,15 +199,18 @@ On Debian or Ubuntu, just download and open one of the .deb packages: <https://g
199199

200200
In some cases, like for MAMP installs, you might not want to use the default PHP binary.
201201

202-
To change it, you need to set the WP_CLI_PHP environment variable in your `.bash_profile`:
202+
To use the latest PHP version provided by MAMP, you'll need to modify your `PATH` environment variable with the following added to your `~/.bash_profile` or `~/.zsh_profile`:
203203

204-
export WP_CLI_PHP=/Applications/MAMP/.../bin/php
204+
PHP_VERSION=ls /Applications/MAMP/bin/php/ | sort -n | tail -1
205+
export PATH=/Applications/MAMP/bin/php/${PHP_VERSION}/bin:$PATH
205206

206207
Once you have added that and saved the file, reload the file with:
207208

208209
source ~/.bash_profile
209210

210-
After you've done that, run `wp --info` to make sure it took.
211+
After you've done that, run `wp --info` to make sure the change has been applied correctly.
212+
213+
For Git and Composer-based WP-CLI installation, you can alternatively set the `WP_CLI_PHP` environment variable, if you don't want to modify `PATH` for some reason.
211214

212215
### Installing on MediaTemple
213216

0 commit comments

Comments
 (0)