DEV Community

Cover image for 裝 WP-CLI
Leon
Leon

Posted on • Originally published at editor.leonh.space

裝 WP-CLI

在裝 WordPress 之前,先裝 WP-CLI

參照 WP-CLI 〈Installing〉文件。

抓下來:

$ curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
Enter fullscreen mode Exit fullscreen mode

確認一下運作正常:

$ php wp-cli.phar --info
Enter fullscreen mode Exit fullscreen mode

加上可執行屬性:

$ chmod +x wp-cli.phar
Enter fullscreen mode Exit fullscreen mode

移放到 /usr/local/bin/wp:

$ sudo mv wp-cli.phar /usr/local/bin/wp
Enter fullscreen mode Exit fullscreen mode

再次確認運作正常:

$ wp --info
Enter fullscreen mode Exit fullscreen mode

很簡單。

我是用 CentOS,不過以上步驟應該都是通用的。

Top comments (0)