My Kirby page content stopped parsing

Kirby version: 2.5.12

The site was working fine but then a few days ago it wasn’t. I think my shared host upgraded to PHP 7.

At first the whole page was broken. I then search through all files replacing <? with <?php and <?= with <?php echo After that the basic template of each page worked. However, the content of the page don’t seem to get parsed. They appear exactly how they are in their source text file or editor. Without the new line.

Can anyone give me some pointer how I can fix this please?

Could you please post your template?

Content is under home.php echo $page->text()->kirbytext(). Breadcrumb and side bar (aside) are working properly.

<?php snippet('header') ?>

<div class="container flex-row ">
    <div class="content main">
        <p class="breadcrumb">
            <?php if ($page->parent()->exists()): ?>
                <a href="<?php echo $page->parent()->url()?>"><?php echo $page->parent()->title()?></a>
                / <?php echo html($page->title()) ?>
            <?php else: ?>
            <?php endif ?>
        <?php echo $page->text()->kirbytext() ?>
        <?php snippet('aside') ?>
        <?php if ($page->aside()->exists()): ?>
            <?php snippet($page->aside()); ?>
        <?php endif ?>
<?php snippet('footer') ?>

I went back and added semi-colon where they should be, no difference.

That’s really weird. Since you are using kirbytext() to render the content, it should actually get parsed. Your code looks ok otherwise.

If your hosting service updated to a new PHP version, maybe something is missing from that version.


I found something even stranger… 1 of the page actually works…

If you follow the side bar to other content tho they don’t.

Maybe if I take this chance to upgrade my Kirby… Do I need to buy another license if I want to give 3 a spin? How easy is it to convert the content over?

Or maybe a newer build of 2.x

When creating this content tho I really was wishing for a set-it-and-forget sort of approach :thinking:

Do I need to buy another license if I want to give 3 a spin?

As long as you run it on your local machine for developing, you don’t need a license. So you can test it :+1:

How easy is it to convert the content over?

Updating from K2 to K3 is usually painless, if you follow the guide AND if you’re not dependant on K2 plugins that weren’t ported to K3 yet.

I see. Thank you for the info.

I think I will try to update newer 2.x first in case it may just work. I assume the plain-kit on the main page is now Kirby 3? Is the 2.x still available, can anyone point me to it please?

Looks like my host is now on PHP 7.4 so that should be OK for Kirby 3 if I really need to.

The K2 starterkit can still be found here:

TBH, I doubt the problem is in the PHP version as the core team confirmed PHP 7.4 compatibility for Kirby 2:thinking: -> try upgrading it to the latest version before everything else.

When creating this content tho I really was wishing for a set-it-and-forget sort of approach

This approach is only reasonable when you are in total control of your environment, but:

I think my shared host upgraded to PHP 7

you are not - and to be sure if your shared host did change something you should try to figure out, i.e. the PHP version. Place a file called somefile.php somewhere in your web accessible path with the content

<?php phpinfo(); ?>

an open it in your browser and it will give you much important information which could help to track down the problem.

AFAIK, the most recent version of Kirby 2 is 2.5.13, so you are not far away, but if you like, you could upgrade it just by replacing your /kirby folder with that of the plainkit, but first check if your /kirby folder is unchanged from that from of the original 2.5.12. (but tbh I do not think this is a problem related to the minor difference in Kirby version given your description above).

Here’s phpinfo page. If you spot anything wrong please let me know.

Do I need to upload the panel folder as well? It seem to also got updated pretty recently on the repo?

If you need the Panel, then yes, you have to update, the version numbers always have to be in sync. If you don’t need the Panel, you don’t need the Panel folder at all.

OK it’s definitely not Kirby. Something weird with my host. I duplicated my entire htdocs into a sub domain and it works. They are identical.

I’m not using any .htaccess either. I’ll contact the host if they can help check this out but if anything cross your mind please let me know.

I think you are on a good path. Compare the _phpver.php call from your main domain and your subdomain. The subdomain is using a complete different PHP version…

Oh really. That’s interesting.

You’re right, my subdomain is still PHP 5.

So possibly something missing in the PHP 7? Is the phpinfo of my main domain showing anything missing that might be needed by Kirby?

At first glance, except from the short_open_tag I did not see anything, but it would be better if one of the more deeply involved supporters here will have a look into it.

But, maybe a workaround: If you are able to run a subdomain on an old PHP version, you might be able to configure this for your main domain as well. This might give you the time to investigate while your site is running well. And then you can go the other way round and enable PHP 7.4 for your subdomain and test.

N.B.: Do not forget to remove the _phpver.php when you finished…

Have you already updated to the most recent 2.5.13 version? I think older versions are not compatible with PHP 7.4.

Yes I did. In the Panel is showing 2.5.13 for Toolkit/Kirby/Panel.

Lower PHP version to 7.3.14 seems to fix the problem.