最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

deprecation - Overwrote index.php. When I restored it, I got lots of Notice level errors

programmeradmin0浏览0评论

I overwrote the index.php file in the main directory of wordpress.

I was working on something else and uploaded an index.php file from a different project. I didn't realize and no-one pointed it out to me for about a week.

I replaced it with the one on my hard drive and got lots of Notice and Deprecated errors.

I thought maybe my version was too old, so I checked wp-includes/versions.php and found the site was reporting $wp_version = '5.2.3';

I downloaded the zip file for that, extracted the index.php file and uploaded it. I still get those errors.

Below the errors, the site seems to load. The admin area, however, will not load because the displayed errors cause headers to be sent, triggering "headers already sent" errors.

When I look at the index.php file, it's hard to imagine that this simple file is actually the cause of the problem, but since that's that file I killed, it's my first suspect of where my trouble lies.

What are some troubleshooting steps I can take to correct this issue?

I overwrote the index.php file in the main directory of wordpress.

I was working on something else and uploaded an index.php file from a different project. I didn't realize and no-one pointed it out to me for about a week.

I replaced it with the one on my hard drive and got lots of Notice and Deprecated errors.

I thought maybe my version was too old, so I checked wp-includes/versions.php and found the site was reporting $wp_version = '5.2.3';

I downloaded the zip file for that, extracted the index.php file and uploaded it. I still get those errors.

Below the errors, the site seems to load. The admin area, however, will not load because the displayed errors cause headers to be sent, triggering "headers already sent" errors.

When I look at the index.php file, it's hard to imagine that this simple file is actually the cause of the problem, but since that's that file I killed, it's my first suspect of where my trouble lies.

What are some troubleshooting steps I can take to correct this issue?

Share Improve this question asked Oct 17, 2019 at 20:27 IJustMightBeAnIdiotIJustMightBeAnIdiot 192 bronze badges 3
  • I tried disabling PHP display_errors and it didn't help. I used phpinfo() to verify the setting was "off". It is, for local and master setting. – IJustMightBeAnIdiot Commented Oct 17, 2019 at 21:13
  • What are the errors/notices? And have you tried downloading a fresh copy of WP and installing it over the top to replace the files? That way you know they're the originals? You can do that using the reinstall button on the check updates page in WP Admin – Tom J Nowell Commented Oct 17, 2019 at 21:38
  • When you suppress error reporting the problem still exists, fills good and close your eyes to the reality. For the brand-new index.php content look here. – Max Yudin Commented Oct 18, 2019 at 9:30
Add a comment  | 

1 Answer 1

Reset to default 1

Someone else had tried to help my client. They had enabled debugging in /wp-config.php

define('WP_DEBUG', true);

When I turned off debugging, the site and admin loaded correctly.

发布评论

评论列表(0)

  1. 暂无评论