Thread tagged as: Problem, Error, Configuration

Nothing loads when production mode set to PERCH_PRODUCTION

The site loads fine when production mode is set to PERCH_DEVELOPMENT but both site and admin are blank when set to PERCH_PRODUCTION. Any idea why?

I just moved a site live by moving all files from the dev subdomain to the site root. I've changed the website URL in settings also and checked the live domain in my account / licence section. Perch & Apps are all up to date [Installed apps: content (2.5.4), assets (2.5.4), perch_blog (4.1), perch_forms (1.7), perch_gallery (2.8.5) ]

Presumably it's not good to leave a live site in development mode?

Adam Green

Adam Green 0 points

  • 7 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

If your site is blank then you have a PHP error so the first thing to do would be to see what that error is.

Thanks Rachel, I checked the error log and was getting the following: [11-Aug-2014 22:25:43 UTC] PHP Fatal error: Call to undefined function     define() in /home/user/public_html/perch/config/config.php on line 25

For some reason, it didn't like this:     define('PERCH_PRODUCTION_MODE', PERCH_PRODUCTION);

But was fine with this: define('PERCH_PRODUCTION_MODE', PERCH_PRODUCTION);

Damned if I can spot the difference! May be some whitespace issue? Anyway all sorted now. Thanks again for your help.

I have a related question ... I've not seen this PERCH_PRODUCTION_MODE parameter before and therefore never used it on any site I've developed. I see it mentioned on but I can't find any mention of what the settings actually do. Anyone advise? Or maybe I just try it on a test site and see for myself. Thanks, Graham

Hi Graham, When a site is under development, i.e. on a local server, I set PERCH_PRODUCTION_MODE to PERCH_DEVELOPMENT as any changes to templates or php code are reflected immediately on the site. As far as I can tell, things start caching when you move to PERCH_PRODUCTION - I've been thrown before when changes to templates aren't updating in the front end because I was developing in production mode. Drew and Rachel will doubtless explain this better!