Kirby site not rendering in localhost

Hi, I’m unsuccessfully trying to make a Kirby 3 site render in my localhost set up on Mojave (10.14.2). What am I doing wrong?

The project is located at /username/sites/my-kirby-project.
Visiting the URL http://localhost/~username/ with Chrome displays a list of all the containing folders, which is nice, but when I visit http://localhost/~username/my-kirby-project the website is not rendered in the browser, instead it shows the index.php code.

I figured it might have something to do with the .htaccess and “RewriteBase /”, but nothing I tried worked.

Circumstances that might or might not be relevant:

  • i followed these instructions to set up the localhost
  • MacOS Apache Version 2.4.34
  • sudo apachectl configtest returns syntax ok
  • PHP Version 7.1.19

So, does anyone know, where I messed up?

We do not recommend running it with the preinstalled php/Apache server. This has caused a bunch of problems for other users before. Do you have the option to use Mamp or Valet+?

Maybe this helps?

Thank you very much for your quick response!
I tried it with Mamp and the same error ocurred, but I stumbled upon this thread, which happened to present my solution:

I’ll quote it here:

Fixed it. Turns out I had an .htaccess files in the parent directory, with the following line in it:

AddType x-mapp-php5 .php

Removed the file and now PHP executes properly. I guess I don’t need to have this .htaccess file on my local machine.


1 Like