来自WPEngine备份的WordPress项目中的PHP解析错误

Mou*_*ous 3 php wordpress

我继承了一个Wordpress项目,我正在尝试设置它.我没有Wordpress的经验,也可能说我没有PHP经验.到目前为止,我已经设法在我的本地机器上设置了环境,但是我仍然遇到PHP解析错误,我无法通过Google搜索找到解决方案.我想至少让我的机器上运行现有的项目.

当我在本地打开我的网站时,我被重定向到$ ROOT/wp-admin/install.php,我在apache error_log中收到此错误:

[Wed Oct 22 22:32:42 2014] [error] [client ::1] PHP Parse error:  parse error in /path/to/project/wp-content/mu-plugins/wpengine-common/plugin.php on line 788
Run Code Online (Sandbox Code Playgroud)

788号线是

    public function disable_indiv_plugin_update_notices( $value ) {
Run Code Online (Sandbox Code Playgroud)

而周围的代码是

function wpengine_credits() {

        if ( get_option( 'stylesheet' ) != 'twentyeleven' && get_option( 'template' ) != 'twentyeleven' )
        return false;

    if ( !defined('WPE_FOOTER_HTML') OR !WPE_FOOTER_HTML OR $this->already_emitted_powered_by == true )
        return false;

    //to prevent repeating
    $this->already_emitted_powered_by = true; ?>
        <div id="site-host">
                WP Engine <a href="http://wpengine.com" title="<?php esc_attr_e( 'Managed WordPress Hosting', 'wpengine' ); ?>"><?php printf( __( '%s.', 'wpengine' ), 'WordPress Hosting' ); ?></a>
    </div>
        <?php
    }

public function disable_indiv_plugin_update_notices( $value ) {
        $plugins_to_disable_notices_for = array();
        $basename = '';
        foreach ( $plugins_to_disable_notices_for as $plugin )
                $basename = plugin_basename( $plugin );
        if ( isset( $value->response[@$basename] ) )
                unset( $value->response[$basename] );
        return $value;
    }

public function get_powered_by_html( $affiliate_code = null ) {
    if ( ( ! defined('WPE_FOOTER_HTML') OR !WPE_FOOTER_HTML ) AND !$this->is_widget ) return "";

    $this->already_emitted_powered_by = true;

    if(WPE_FOOTER_HTML !== "") {
        $html = WPE_FOOTER_HTML;
    } else {
        $html = $this->view('general/powered-by',array('affiliate_code'=>$affiliate_code),false);
    }


    return "<span class=\"wpengine-promo\">$html</span>";
}
Run Code Online (Sandbox Code Playgroud)

我觉得它与我的PHP版本有关.我正在运行PHP 5.4.30.建议使用其他类似问题的解决方案

任何建议,将不胜感激.

Dan*_*l C 10

删除LOCAL环境中的mu-plugins文件夹...您看到的错误是WP Engine在其服务器上运行的特殊插件,供内部使用.如您所见,如果在WP引擎环境之外运行,它将失败.

当您将本地环境重新投入生产时,请确保不要删除WP引擎服务器上的mu-plugins文件夹!