Skip to content

Instantly share code, notes, and snippets.

@mklasen
Last active September 21, 2022 02:17
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mklasen/0004dfc50500cef0d63aabc8d565a2b9 to your computer and use it in GitHub Desktop.
Save mklasen/0004dfc50500cef0d63aabc8d565a2b9 to your computer and use it in GitHub Desktop.
Install wp-cli on shared hosting (Antagonist)

Download WP-CLI

curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar

Test to see if it works correctly

php wp-cli.phar --info

Add extra permissions

chmod +x wp-cli.phar

Create a directory for tools like these

mkdir ~/tools/

Move wp-cli.phar to tools

mv wp-cli.phar ~/tools/

Edit your ~/.bash_profile

nano ~/.bash_profile

Add the following line

alias wp="php ~/tools/wp-cli.phar"

Reload your profile

source ~/.bash_profile

Test if it works with the alias

wp --info

All done!

@loorlab
Copy link

loorlab commented Sep 21, 2022

💜

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment