具有自定义核心的“ wp cli” wp_get_server_protocol错误

时间:2018-07-13 09:27:59

标签: php wordpress wp-cli

我尝试将wopdpress文件夹名称更改为core,将wp-content更改为content,这在浏览器中效果很好,但不适用于wp cli。

public_html内容:核心/内容/ index.php / config.php /

config.php

init(input: ProtocolType? = nil) {
        super.init(nibName: nil, bundle: nil)
        self.input = input
}

required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
}

wp调试:

...
define( 'WP_HOME', 'https://wpconf.local/core' );
define('WP_CONTENT_DIR', '/content');
define('WP_CONTENT_URL', 'https://wpconf.local/content');

if ( !defined('ABSPATH') )
        define('ABSPATH', dirname(__FILE__) . '/');


require_once(ABSPATH . 'wp-settings.php');

core / wpconfig.php:

vagrant@wpconf:/www/wpconf$ wp config path --debug
Debug (bootstrap): Using default global config: /home/vagrant/.wp-cli/config.yml (0.169s)
Debug (bootstrap): No project config found (0.171s)
Debug (bootstrap): argv: /usr/local/bin/wp config path --debug (0.171s)
Debug (bootstrap): ABSPATH defined: /www/wpconf/public_html/core/ (0.172s)
Debug (bootstrap): Running command: config path (0.173s)
/www/wpconf/public_html/core/wp-config.php

但核心安装:

<?php
$config = 'config.php';
$filepath = dirname(__DIR__) . '/';
echo  $filepath . '/' . $config  ;
if( file_exists( $filepath . '/' . $config ) ){
        define( 'FILEPATH', $filepath );
        require_once( FILEPATH . '/' . $config);
}else{
        die('not found');
}

require_once(ABSPATH . 'wp-settings.php');

config get也不起作用: vagrant @ wpconf:/ www / wpconf $ wp config get

/www/wpconf$ wp core install
PHP Fatal error:  Cannot redeclare wp_get_server_protocol() (previously declared in /www/wpconf/public_html/core/wp-includes/load.php:15) in /www/wpconf/public_html/core/wp-includes/load.php on line 21

我需要解决什么? 谢谢!

0 个答案:

没有答案