Pagination only works on localhost

Hello, I´m working on a website and I´m using the pagination object for my projects section. The problem is, the pagination works fine on my local host, but when I upload my site to my godaddy server it crashes when I try to access any page other than the first one.

this is the php variables and template:

  $projects = $page->children()->paginate(9);
  $paginationProjects = $projects->pagination();  
<div class="pagination">
<?php if ($paginationProjects->hasPages()): ?>
  <div class="pagination__container">

    <?php foreach ($paginationProjects->range(2) as $r): ?>
      <a <?= $paginationProjects->page() === $r ? ' aria-current="page"' : '' ?> href="<?= $paginationProjects->pageURL($r) ?>">
        <?= $r ?>
    <?php endforeach ?>

    <a class="next" href="<?= $paginationProjects->nextPageURL() ?>">Siguiente ></a>

<?php endif ?>

Is there an error message? Please enable debugging to hopefully get an error.

I don’t see a problem with your code, so maybe it’s not this snippet causing the error but the rest of the template.

Hi, thank you for responding. I had debug turned off. I turned it on and this is the error that I get:

Apparently kirby is not recognizing the second page but only in my server, on localhost it works fine even with debug mode on.

Are you using the latest Kirby version?

I’m using kirby version 3.3.6

Try if updating to 3.4.2 solves the issue.

I tried updating (changing the kirby folder) to version 3.4.2 and it crashed the entire site, I got a blank page even with debug on. I didn´t removed the content folder from my site though, because it has a lot of data that I don´t want to delete.

Are you using any plugins?