Errormessage: Need help to debug this

We develop a site on a couple of machines using git. Everythings works on alle 4 machines.
Now we moved it to the real server and one specific feature doesn’t work on that machine: The blogposts themselfs do not open. I get this on every blogpost:

return function($page) { // fetch the basic set of pages $articles = $page->children()->listed()->flip(); // fetch all tags $tags = $articles->pluck('tags', ',', true); // add the tag filter if($tag = param('tag')) { $articles = $articles->filterBy('tags', $tag, ','); } // apply pagination $articles = $articles->paginate(10); $pagination = $articles->pagination(); return compact('articles', 'tags', 'tag', 'pagination'); };

Again: It works one every other machine we tested it one, just not the production-server… I have no idea whatsoever…
The machine with the issue is a Ubuntu LTS 18.04 Server, the webserver is Apache inside a docker-container. So perhaps some kind of library is not working there? But why does everything else on the page work (including other pages with pagination)?!

Any pointers are very much appreciated!

Here are two examples of broken pages:

https://kgsrastede.de/blogs/schuelerwettbewerb-econo-me
https://kgsrastede.de/blogs/aktion-black-lives-matter

Here is an example of a working subpage

https://kgsrastede.de/allgemeines/schulstruktur/zeitraster

Here is the PHP-Code of the broken blog.

<?php

$items = $page->children()->flip();

$list = $items->paginate(5);

foreach ($list as $item) : ?>

  <div class="col-md-12 mt-4">

    <div class="card-body">

      <h4 class="card-title">

        <a href="<?= $item->url() ?>"><?= $item->title() ?></a>

      </h4>

      <p class="card-category">

        <div class="author">

          von

          <a href="#">

            <b><?= $item->author() ?></b>

          </a> Datum: <?= $item->date()->toDate("d.m.Y") ?>

        </div>

      </p>

      <div class="card-description">

        <?= $item->Text()->blocks()->excerpt(250) ?>

        <a href="<?= $item->url() ?>">...weiterlesen</a>

      </div>

    </div>

  </div>

  <hr>

<?php endforeach ?>

<?php $pagination = $list->pagination() ?>

<nav>

  <ul class="pagination">

    <?php if ($pagination->hasPrevPage()) : ?>

      <li class="page-item">

        <a class="page-link" href="<?= $pagination->prevPageURL() ?>">‹</a>

      </li>

    <?php else : ?>

      <li>

        <span>‹</span>

      </li>

    <?php endif ?>

    <!-- Hier nun die mittleren Elemente -->

    <?php foreach ($pagination->range(10) as $r) : ?>

      <li class="page-item <?= $pagination->page() === $r ? 'active' : '' ?>">

        <!-- Hier steckt hinter:

        Wenn page() identisch ist mit $r schreibe aria-current (also aktuelle Seite),

        ansonsten mache '', also füge nichts ein. Das ist eine extreme Abkürzung.

        Damit wird im Endeffekt erreicht, dass mit nur einer Zeile die aktuelle Seite

        markiert

      -->

        <a class="page-link" <?= $pagination->page() === $r ? 'aria-current="page"' : '' ?> href="<?= $pagination->pageURL($r) ?>">

          <?= $r ?>

        </a>

      </li>

    <?php endforeach ?>

    <?php if ($pagination->hasNextPage()) : ?>

      <li class="page-item">

        <a class="page-link" href="<?= $pagination->nextPageURL() ?>">›</a>

      </li>

    <?php else : ?>

      <li class="page-item">

        <span>›</span>

      </li>

    <?php endif ?>

  </ul>

</nav>

Actually, the PHP-code of the blog itself is this code:

<?php snippet('header') ?>

<?php snippet('page-header') ?>

<h1><?= $page->title()->text() ?></h1>

<h3><?= $page->heading()->text() ?></h3>

Datum: <?= $page->date()->toDate("d.m.Y") ?>

Autor: <?= $page->author() ?>

<?= $page->text()->blocks() ?>

<?php if ($page->fotoansicht() == 'carousel') : ?>

  <?php snippet('carousel') ?>

<?php elseif($page->fotoansicht() == 'gallery') : ?> 

  <?php snippet('gallery') ?>

<?php else: ?> 

<!-- Bilder werden vom Autor manuel gesetzt -->

<?php endif ?>

<?php snippet('footer') ?>

The other code is the template of https://kgsrastede.de/blogs/ and works; sorry for the confusion

The code you are seeing instead of the blogpost looks like a controller. What does the entire controller for the blog look like? I think something is wrong there since its just printing it out instead of parsing it.

Ubuntu is also case sensitive so anywhere you do a snippet call, make sure the filename matches the actual filename, including case. Controllers, and snippets and templates should all be in lower case. Im guessing it worked on 4 machines locally becasue they are Windows, which doesnt care about case.

I also think this is probably a question with wrongly named text files or template/controller etc. files. Since parsing PHP works in general, there’s probably a file somewhere without an opening PHP tag that is used in this case instead of the intended template. Because this code is definitely not the correct controller for an article, but for the parent.

Oh my god, it really was a missing <?php in my controller.

Wow

I still don’t see why it ever worked on Windows, seems that LAMP is far more picky than WAMP…

Thank you!