使用WP-CLI命令行工具安装WordPress

by Web全栈工程师 on 2013 年 08 月 09 日

在Linux或者Mac系统里,不用浏览器,直接使用wp-cli命令,就能安装、升级、配置wordpress,十分方便,

安装如下:

curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
php wp-cli.phar --info
chmod +x wp-cli.phar
sudo mv wp-cli.phar /usr/local/bin/wp
wp --info

记得要切换成普通用户运行命令,否会有权限提示,或者加上 –allow-root 参数:

wp --info --allow-root

使用方法:

Available commands:
    wp blog create|delete
    wp cache add|decr|delete|flush|get|incr|replace|set|type
    wp comment create|delete|trash|untrash|spam|unspam|approve|unapprove|count|status|last
    wp core download|config|is-installed|install|install-network|version|update|update-db
    wp db create|drop|reset|optimize|repair|connect|cli|query|export|import
    wp eval-file
    ...

See \'wp help \' for more information on a specific command.

更多资料: http://wp-cli.org/

Comments on this entry are closed.

Previous post:

Next post: