Problem copying site from server to local: undefined function nocache_headers()
-
I have been tasked with “recovering” a website that my company created a while ago. When I say recover, what I mean is that we have no version control repo for this site and it hasn’t been updated in a while, so I need to copy it down to my localhost, standardize the folder structure to match our other stuff, update the site/plugins, put all that into a git repo, and then redeploy to the site. I have done this numerous times before, the process is pretty straight forward, Set up a virtualhost, export the database as a sql file, create a local database and user, import the sql file into the new database, adjust the wp-config file to match the database settings and copy the site files to my local using winscp.
This one particular site has something wrong with it and when I try to access wp-admin locally, it throws the following fatal error:
Fatal error: Uncaught Error: Call to undefined function nocache_headers() in wp-admin\admin.php on line 33
For reference, I am on Windows 10, running Wamp64 and the server is Ubuntu 18.04 LTS with standard LAMP stack. The wordpress install is on version 4.9.8. I know that error message is technically wrong, as the function is defined in wp-includes/functions.php, but *something* is going on that is preventing me from running this site on my Windows machine, while it runs perfectly fine on the server (Admin included). I thought it might be a weird OS/php version issue, but I have tried php 7.0.33, 7.1.29, 7.2.18 and even 5.6.40 just in case and the result is the same each time.
I have disabled the plugins by renaming the plugin directory and setting the active_plugins row in the options table to ‘a:0:{}’ but the problem persists. I have seen a few examples of this online, but they’re mostly caused by wp- files in the root getting zeroed out, or a bad plugin, and that’s not the case here. What other steps could I try to get this working locally?
Thanks in advance for any help.
- The topic ‘Problem copying site from server to local: undefined function nocache_headers()’ is closed to new replies.