大约一个月前i can no longer update any plugins or wordpress core on my website. 当我试图更新网站时,它被打乱了。Jetpack然后在5-8分钟后为我重新激活网站。当它重新上线时,我在管理部分看到:
您的网站出现严重错误。请查看您的站点管理电子邮件收件箱以了解说明。
不幸的是,我没有收到那封电子邮件。因此,没有进一步的信息。
尽管存在这些问题,我可以继续发表文章,网站的其余部分也能如期工作。
我一直在阅读可能存在的问题,并认为这可能与我的webhosts设置(DigitalOcean)和目录权限有关。
我需要看什么来确定目录权限是否是问题所在?或者,让网站这样做可能会有什么问题?
更新:我已经看过error.log
我看到以下几行重复:
[Tue Jan 21 09:15:26.128769 2020] [fcgid:warn] [pid 16817] [client 52.9.128.29:42158] mod_fcgid: stderr: PHP Fatal error: Uncaught Error: Call to undefined function get_header() in /var/www/clients/client1/web1/web/wp-content/themes/study-circle/index.php:13
[Tue Jan 21 09:15:26.128824 2020] [fcgid:warn] [pid 16817] [client 52.9.128.29:42158] mod_fcgid: stderr: Stack trace:
[Tue Jan 21 09:15:26.128832 2020] [fcgid:warn] [pid 16817] [client 52.9.128.29:42158] mod_fcgid: stderr: #0 {main}
[Tue Jan 21 09:15:26.128837 2020] [fcgid:warn] [pid 16817] [client 52.9.128.29:42158] mod_fcgid: stderr: thrown in /var/www/clients/client1/web1/web/wp-content/themes/study-circle/index.php on line 13
索引。php代码在我看来很正常。。。
<?php
/**
* The template for displaying home page.
*
* This is the template that displays all pages by default.
* Please note that this is the WordPress construct of pages
* and that other \'pages\' on your WordPress site will use a
* different template.
*
* @package Study Circle
*/
get_header();
?>
<div class="container">
<div class="page_content">
<section class="site-main">
<div class="blog-post">
<?php
if ( have_posts() ) :
// Start the Loop.
while ( have_posts() ) : the_post();
/*
* Include the post format-specific template for the content. If you want to
* use this in a child theme, then include a file called called content-___.php
* (where ___ is the post format) and that will be used instead.
*/
get_template_part( \'content\' );
endwhile;
// Previous/next post navigation.
the_posts_pagination();
else :
// If no content, include the "No posts found" template.
get_template_part( \'no-results\', \'index\' );
endif;
?>
</div><!-- blog-post -->
</section>
<?php get_sidebar();?>
<div class="clear"></div>
</div><!-- site-aligner -->
</div><!-- content -->
<?php get_footer(); ?>
以及
get_header
wp中的功能包括/通用模板。php:
function get_header( $name = null ) {
/**
* Fires before the header template file is loaded.
*
* @since 2.1.0
* @since 2.8.0 $name parameter added.
*
* @param string|null $name Name of the specific header file to use. null for the default header.
*/
do_action( \'get_header\', $name );
$templates = array();
$name = (string) $name;
if ( \'\' !== $name ) {
$templates[] = "header-{$name}.php";
}
$templates[] = \'header.php\';
locate_template( $templates, true );
}