gpt4 book ai didi

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

转载 作者:可可西里 更新时间:2023-11-01 00:05:20 25 4
gpt4 key购买 nike

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

当我在本地打开我的网站时,我被重定向到 $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

第788行是

    public function disable_indiv_plugin_update_notices( $value ) {

和周围的代码是

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>";
}

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

如有任何建议,我们将不胜感激。

最佳答案

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

当您将本地环境恢复到生产环境时,请确保您没有删除 WP 引擎服务器上的 mu-plugins 文件夹!

关于来自 WPEngine 备份的 Wordpress 项目中的 PHP 解析错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26516656/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com