Kirby 2 Page Error 500

For a client I have to do some changes on an existing Kirby 2 page. Sadly when starting a local webserver in the directory via php -S localhost:8085 the page does not work any more. I didn’t do any changes. So the only thing I can imagine is another PHP-version (I am using php@7.2 right now).

I get the following error:

This page is currently offline due to an unexpected error. We are very sorry for the inconvenience and will fix it as soon as possible.
Advice for developers and administrators:
Enable debug mode to get further information about the error.

In the console I just see:

[Tue Mar  5 17:39:27 2019] ::1:58911 [500]: /
[Tue Mar  5 17:39:31 2019] ::1:58912 [500]: /
[Tue Mar  5 17:39:32 2019] ::1:58933 [500]: /
[Tue Mar  5 17:39:37 2019] ::1:58950 [500]: /

In site/config/config.php I have debugging enabled via c::set('debug', 'true'); but still don’t see any debugging infos.

What can I do? Any idea how to pinpoint where the problem is?

Also where can I find the old docs? I just have to do some small fixes, there is no budget to update to Kirby v3.

c::set(‘debug’, ‘true’);

should be

c::set('debug', true);

Oh, thanks @texnixe!
Now I get some debug infos.

The error I now get is syntax error, unexpected end of file in my home.php template. Weird, since I also checked out an old version which was working 100%. Do you know if there were any changes since PHP version 5.4+ which would result in these errors. I just tested with PHP 5.6, as well as 7.2.
I am 100% sure I have the same code here which is running fine in production.

Use of PHP short tags <? ?> maybe?

I did use these, yes. Were they deprecated?

No, but it depends on your server settings and using these short tags is not recommended at all, as you can well see by running into this issue.

Using the short echo tag <?= , however, is.

Ah, good to know. So replacing all occurrences of <? ... ?> with <?php ... ?> could fix is you think?

Yes, replace <? with <?php and <? echo with <?=.

Great! Thank you so much @texnixe!
I will do these changes and report back if it worked.

It’s working again! Thanks so much @texnixe! This problem was driving me nuts and would have cost me a few grey hair if it wasn’t for you! :raised_hands:

That will come soon enough, no need to speed it up with programming issues :wink:

Too late for that, but good to slow it down a bit by having such great support!

1 Like