Wp-cli无法安装语言

时间:2015-04-08 15:17:48

标签: php wordpress capistrano3

我通过带有基岩配置的composer安装了wordpress项目。

我使用capistrano进行部署。

这里,我的composer.json文件:

{
  "name": "my-project",
  "type": "project",
  "autoload": {
    "psr-0": {"Roots\\Bedrock\\Installer": "scripts"}
  },
  "repositories": [
    {
      "type": "composer",
      "url": "http://wpackagist.org"
    }
  ],
  "require": {
    "php": ">=5.5",
    "composer/installers": "~1.0",
    "vlucas/phpdotenv": "~1.0",
    "johnpbloch/wordpress": "~4.1",
    "wp-cli/wp-cli": "~0.18"
  },
  "scripts": {
    "post-root-package-install": ["Roots\\Bedrock\\Installer::addSalts"]
  },
  "config": {
    "bin-dir": "bin",
    "generate-salts": true
  },
  "minimum-stability": "dev",
  "prefer-stable": true,
  "extra": {
    "installer-paths": {
      "web/app/mu-plugins/{$name}/": ["type:wordpress-muplugin"],
      "web/app/plugins/{$name}/": ["type:wordpress-plugin"],
      "web/app/themes/{$name}/": ["type:wordpress-theme"]
    },
    "wordpress-install-dir": "web/wp"
  }
}

我想安装fr_FR语言,所以我运行了以下wp-cli命令:

./bin/wp core language install fr_FR

这类似于本地的魅力,但在capistrano部署后不在服务器上。我想调试它,但除了这个错误我什么都没有:

htdocs/current$ ./bin/wp --debug core language install fr_FR
Error: Couldn't install language.

有人有这个问题吗?怎么解决?

非常感谢。

2 个答案:

答案 0 :(得分:0)

找到原因。

在我的WordPress生产配置中,我有这个:

define('DISALLOW_FILE_MODS', true);

这禁止对wordpress核心进行任何文件修改。

只需将其设置为false即可使其正常运行。

我必须搜索如何仅为wp-cli禁用它。

答案 1 :(得分:0)

这阻止了我的联系:

define( 'WP_HTTP_BLOCK_EXTERNAL', true );

评论此行或在允许的主机中添加“downloads.wordpress.org”:

define( 'WP_ACCESSIBLE_HOSTS', 'api.wordpress.org, downloads.wordpress.org,*.github.com' );