Problem with page rendering on live site

Finished creating a new site and it all works wonderfully on my localhost, but the rendering of the pages seems to be interrupted half way through each page now that they are on the live web server. Similar breaks seem to happen on each of the Kirby pages.

I’m frustrated and perplexed. Any ideas what’s going wrong?
Here’s the public web address.

Note that some of the links will take you to the old version of the site that will be replaced.

Have you checked the server error logs? There seems to be a server 500 error and something does not get loaded as it should. Maybe a file permission error ?

Also, having spent most of last night debugging why a sitemap.xml worked fine on my local (vagrant) machine, but not on the server, before I this morning realised it wasn’t as much to do with the actual code, but had everything to do with the configuration of the web server (nginx in my case) I think there can be a combination of permissions and configuration.

Looking at your (front-end) code it plainly seems like it stops loading, without throwing errors. Is there are specific function at that location in the templates, that perhaps is looking for an include where the permissions are not correctly set (and so it stops, and shows what it has)? Or do you have any specific routes, either in the Kirby config, or in your site config (at web server level)?

Usually when I debug I use the “cut it half” theory, where I comment out/in code blocks in halves, until I’ve isolated the code that causes the error.

In my case with the sitemap it turned out to be a couple of “locations” in the nginx config, which I have had ever since Kirby 1, and just “carried with me” when setting up a new site. One of the four blocks caused my error. Commenting it out fixed it for me.

I turned on debugging and get this error:
Fatal error: Class ‘DOMDocument’ not found in /usr/local/apache2/htdocs/kirby/vendors/parsedownextra.php on line 434

Solution: enabled the DOM extension in PHP on the server.