Soullivaneuh Soullivaneuh - 1 year ago 94
PHP Question

Wp-cli Couldn't install language

I have a wordpress project installed via composer with bedrock configuration.

I use capistrano for deployment.

Here, my composer.json file:

"name": "my-project",
"type": "project",
"autoload": {
"psr-0": {"Roots\\Bedrock\\Installer": "scripts"}
"repositories": [
"type": "composer",
"url": ""
"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"

I want to install the fr_FR language, so I ran the following wp-cli command:

./bin/wp core language install fr_FR

This works like a charm on local, but not on the server after a capistrano deployment. I want to debug it but I got nothing else than this error:

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

Is someone had this issue? How to solve it?

Many thanks.

Answer Source

Found why.

In my production WordPress configuration, I had this:

define('DISALLOW_FILE_MODS', true);

This disallow any file modification on wordpress core.

Just set it to false to get it working.

I have to search how to disable it only for wp-cli.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download