简体   繁体   English

如何修复“致命错误:未捕获错误:调用未定义函数 get_header()”

[英]How to fix "Fatal error: Uncaught Error: Call to undefined function get_header()"

I am trying to put this website back online.我正试图让这个网站重新上线。 The error message is the following:错误信息如下:

Fatal error: Uncaught Error: Call to undefined function get_header() in /homepages/25/d584099293/htdocs/clickandbuilds/X3DSYSTEMS/wp-content/themes/x3dprotheme/index.php:4 Stack trace: #0 {main} thrown in /homepages/25/d584099293/htdocs/clickandbuilds/X3DSYSTEMS/wp-content/themes/x3dprotheme/index.php on line 4致命错误:未捕获错误:调用 /homepages/25/d584099293/htdocs/clickandbuilds/X3DSYSTEMS/wp-content/themes/x3dprotheme/index.php:4 中的未定义函数 get_header():4 堆栈跟踪:#0 {main} 抛出/homepages/25/d584099293/htdocs/clickandbuilds/X3DSYSTEMS/wp-content/themes/x3dprotheme/index.php 第 4 行

The client told me he "accidentally reset the domain".客户告诉我他“不小心重置了域”。

First when I went on the website, I had an error message about Wordfence and I did what I needed to do to correct it (here what I did:首先,当我访问该网站时,我收到一条关于 Wordfence 的错误消息,我做了我需要做的事情来纠正它(这里我做了什么:

After moving a site or deleting some files, I see: PHP Fatal error: Unknown: Failed opening required /var/www/html/wordfence-waf.php 移动站点或删除一些文件后,我看到:PHP 致命错误:未知:需要打开失败 /var/www/html/wordfence-waf.php

I removed the firewall setup manually.我手动删除了防火墙设置。

Then I got this new error message about index.php :然后我收到关于index.php的新错误消息:

In this index.php, here is what I found:在这个 index.php 中,这是我发现的:

<?php get_header(); ?>

<?php get_footer(); ?>

I try to get this website back online.我试图让这个网站重新上线。

The webhost is 1and1 IONOS.虚拟主机是 1and1 IONOS。 I can't log into WP, but I have SFTP access.我无法登录 WP,但我有 SFTP 访问权限。

What webhost is this?这是什么主机? Maybe if we know, we can ascertain what the "domain reset" involved and backtrack the fix once we know exactly what those steps entailed.也许如果我们知道,我们就可以确定“域重置”涉及什么,并在我们确切知道这些步骤需要什么后回溯修复。

When these sorts of things happen to me (I manage about 30 WordPress sites), the first thing I do is disable all plugins, and sometimes if I can't actually log into WordPress, I remove the plugins via SFTP or through cPanel .当这些事情发生在我身上时(我管理着大约 30 个 WordPress 站点),我做的第一件事就是禁用所有插件,有时如果我无法真正登录 WordPress,我会通过 SFTP 或cPanel删除插件。

You're stuck though if you have no access to the host.如果您无法访问主机,您就会被卡住。 It'll extremely difficult to solve this without access to the server or control panel for the hosting environment.如果无法访问托管环境的服务器或控制面板,将很难解决这个问题。 Do you at least have SFTP access?您至少有 SFTP 访问权限吗?

This looks like a path to a core theme file.这看起来像是核心主题文件的路径。

If you are using child theme, you should be able to update the parent via the theme settings found in your dashboard, without data loss from style sheets, etc. you made in your child theme.如果您使用的是子主题,您应该能够通过仪表板中的主题设置更新父主题,而不会丢失您在子主题中制作的样式表等数据。

This would work like the backup restore as suggested above, but without the need to get into cPanel or FTP.这将像上面建议的备份恢复一样工作,但不需要进入 cPanel 或 FTP。

The client changed the "target" with his webhost, and the site is back online.客户用他的虚拟主机更改了“目标”,网站又重新上线了。

There was also a problem with revolution slider, but anyway, the problem looks solved.旋转滑块也有问题,但无论如何,问题看起来已经解决了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 致命错误:调用未定义的函数get_header() - Fatal error: Call to undefined function get_header() 错误调用未定义的函数get_header() - error Call to undefined function get_header() in 对未定义方法get_header的Moodle致命错误调用 - Moodle fatal error call to undefined method get_header 致命错误:在第 2 行的 index.php 中调用未定义的 function get_header() - Fatal error: Call to undefined function get_header() in index.php on line 2 如何修复 php 致命错误:未捕获错误:调用未定义的 function nm_blog_get_ajax_content()? - How to fix this fatal error of php Fatal error: Uncaught Error: Call to undefined function nm_blog_get_ajax_content()? WordPress调用未定义的函数get_header(); - WordPress call to undefined function get_header(); 调用未定义函数 get_header() - Call to undefined function get_header() 如何修复&#39;未定义的变量:pdo; 致命错误:未捕获的错误:在 null 上调用成员函数 query();&#39;? - How to fix 'Undefined variable: pdo; Fatal error: Uncaught Error: Call to a member function query() on null;'? 致命错误:未捕获错误:调用未定义的函数 get_option() - Fatal error: Uncaught Error: Call to undefined function get_option() 致命错误:未捕获错误:调用未定义的函数 - Fatal error: Uncaught Error: Call to undefined function
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM