PHP built-in server permission denied

Hi there, im trying to test Kirby on my machine. But when I copy everything into the Terminal as mentioned in the “Get up and running guide” and hit enter, I just get a “zsh: permission denied” with the path of the Kirby folder.

Any Idea how to fix that?

Thanks a lot for your help already!

Where exactly did you put the Starterkit files on your machine? From which folder did you try to start up Kirby with

php -S localhost:8000 kirby/router.php

Make sure that the files/folders have the right permissions.

I tried the files from the downloads folder, desktop and user folder but the result is always the same. Permissions of all files and folders are ok.

What is the output when you type ls -la in the starterkit-main folder.

But generally in your user folder, it should work alright.

I think you are trying to execute the Starterkit directory, not PHP.

Try running cd Desktop/starterkit-main first before the PHP command.

1 Like

ls -la gives the same result: zsh: permission denied.
And with cd Desktop/starterkit-main the result is: cd: too many arguments. The same if I have it in the users folder.

You must be inside the starterkit-main folder and then call php -S localhost:8000 kirby/router.php.

Another way to open the folder in Terminal is to rightclick on the folder in Finder, then from the context menu choose Services => Open new terminal at folder.

Still does not seam to work. If I open the folder with => Open new terminal at folder the result is: zsh: command not found: php. If I just drag and drop it into Terminal it still shows:zsh: permission denied.

Command not found means that either php is not installed on your machine or it’s not in your path. Since macOS Monterey, PHP isn’t preinstalled anymore.

If you are not familiar with the Terminal, maybe consider using a tool like Mamp instead. It comes with everything you need to run Kirby:

Thanks, that helped. Didn’t know that php isn’t preinstalled. I installed Homebrew and now it works. Thanks a lot for your help!