1

This is a very common wp-cli error while using MAMP. I installed wp-cli, exported the php version MAMP is using to the WP_CLI_PHP variable as recommended by the instructions. The output of $ wp --info is:

PHP binary: /Applications/MAMP/bin/php/php5.6.2/bin/php
PHP version:    5.6.2
php.ini used:   /Applications/MAMP/bin/php/php5.6.2/conf/php.ini
WP-CLI root dir:    phar://wp-cli.phar
WP-CLI global config:   
WP-CLI project config:  
WP-CLI version: 0.20.1

I've followed along with all the solutions for this, but I'm still getting a timeout and error in connecting to the database. I also have MAMP running while running wp-cli commands. Any ideas?

4

1 回答 1

0

在看到关于 if 语句在 wp-config 文件中使用时可能对 wp-cli 产生的问题的评论后我回去检查了我的。配置文件使用许多 if 语句来设置 $config_file 变量。我注释掉了整个块并简单地设置了$config_file = "path_to_config". 这似乎成功了。

于 2015-09-29T22:16:46.270 回答