Install wp-cli via laragon terminal?
Hi there, hope you can help? Trying to install wp-cli (for the 1st time) via the laragon terminal using the instructions from the official wp-cli guide: https://make.wordpress.org/cli/handbook/installing/
Everything worked until the very last command:
sudo mv wp-cli.phar /usr/local/bin/wp
'sudo' is not recognized as an internal or external command,
operable program or batch file.
So i then tried manually moving the file via windows explorer to
wp --infointo terminal to which i get:
'wp' is not recognized as an internal or external command, operable program or batch file.
sudois a command in Linux. You can check
bin\composerto see known how to handle
Sorry, having difficulty deciphering what you meant? I understand that .phar is a compressed file but what did you mean by 'check'? Googling that led me to this article
I downloaded composer using these instructions
..so now I have the following in my laragon/www/ directory:
php wp-cli.phar --info
Does output the right info
But I still can't bind
...and none the wiser as to how composer.phar comes into this?
Could not open input file: bin/composer.pharand the same with
php bin/wp-cli.phar. Typing the filename creates an OS modal for me to select the application to open it with.
Thanks for your patience.
Shall i just install Windows Subsystem for Linux and follow the original wp-cli install guide?
I'm pretty sure the wp cli instructions are assuming you're using a linux machine (or at least a linux virtual machine or subsystem). So they'll need to be tweaked a bit, seeing how Laragon is running on Windows. Not sure how yet, just learned about Laragon today!
Here's some instructions for installing WP CLI on windows: https://deluxeblogtips.com/install-wp-cli-windows/ which should help (I haven't gone through them all yet)
@mnelson4 thanks, look forward to giving that a try in the morning!
Thanks @mnelson4, after seeing the long article from you link. I decided to create a tutorial for that. It is very easy with Laragon.
You can check it here:
Sorry @Marc-Thornton, I was busy improving the Auto Generated SSL feature for Laragon 3.3.1 and did not notice that you were still stuck on it. I hope this helps.
@Marc-Thornton : I've also updated with the lazy way:
cd C:\laragon\usr\bin && curl -L -O https://raw.github.com/wp-cli/builds/gh-pages/phar/wp-cli.phar && echo @ECHO OFF > wp.bat && echo php "%~dp0wp-cli.phar" %* >> wp.bat
@leokhoa ah that's so easy! works great, appreciated.