Issues with API parsing running Plainkit on localhost

Hello All,

I’ve been using Kirby 2 for a while and am making the jump to Kirby 3(!) however I can’t seem to get even the Plainkit version working on my localhost environment for development.

I have downloaded the ‘Plainkit’ and set up a server using php -S localhost:8000 which seems to work OK… but when I try to add images or any media I am given the response: The JSON response from the API could not be parsed. Please check your API connection. I’ve looked around on the forum and while there seem to be people have had similar issues when upgrading from Kirby 2 I am simply trying to start a fresh/blank project.

I’ve not had any problems with this method in the past? If someone can recommend a way to resolve this issue or a different method of locally hosting I’d be more than grateful.

Thanks in advance!

If you use the built-in server, you have to start it with Kirby’s router.

php -S localhost:8000 kirby/router.php

If you want to run Kirby 3 like that, you’ld have to launch your “server” like this: php -S localhost:8000 kirby/router.php. See docs for more info.

Ah, OK – @texnixe thank you! I’ll do that now…

However, I’m just wondering, I see it says that this is ‘not recommended’? I appreciate this isn’t in the scope of the original question but do you perhaps have any advice on other recommended methods of setting up a local development environment?

I think it works for most use cases, although people sometimes run into issues, so if it works for you, you might as well stick with it.

I’m personally still on Mamp and can live with the fact that it’s rather slow on Mojave, others have switched to Laraval Valet or Valet+ (or other solutions)

OK, thanks for advice @texnixe! Just wanted to make sure I wasn’t doing something terribly wrong :dizzy_face:

Will check out these Valet options in the future :slightly_smiling_face: Thanks for all your help!

Strange enough, since a few days, I have this issue as well (like the other issue I mentioned a few minutes ago). I did not change anything with Mamp. But installed Big Sur since then … I guess I will try re-installing mamp