johnbillion/extended-cpts

Fatal Error after migrating from production to staging environment

fishnyc22 opened this issue · 3 comments

Hey John, I'm stumped. I inherited this project and have been making minor style changes and improvements per my clients request. I hit a few requests that I'd feel more comfortable testing on staging first before pushing live. Host doesn't offer a simple "staging" environment so I've downloaded the project and set up a local version my Mac.

Anyway... After setting it all up, I get this error:
Fatal error: Uncaught Error: Call to undefined function register_extended_post_type()

I've spent days trying to figure this out. Not really too experienced with composer. I'm unsure why if I downloaded all assets to my local install I wouldn't have everything I need for this site to run. I've tried running composer install on the root directory among other commands. But no luck. From what I gather, there's calls to your functions being made before your library is initiated.

What am I missing here? Any insight would be very much appreciated.

Production server is running PHP 7.4.28
Local server is running PHP 7.4.2

Thank you.

Only thing I can think of is that the project is loading vendor/autoload.php somewhere that's not in the files you copied over -- likely in wp-config.php or in a plugin inside mu-plugins. If the library is installed as a Composer dependency then this file needs to be loaded so Composer can load the classes and functions of the dependencies.

JOHN!!!! THANK YOU!!!! That was the one file I did not copy over because the local setup created one to the DB so I left it. I can not thank you enough for that tip. I spent HOURS trying to debug this.

Can I buy you a beer? Venmo?

THANK YOU!!!.

Let's call it an IOU (boy have they added up over the last two years...) and hopefully I'll cash it in at some point :D