Can't access site at IP server

Hi! I’ve been working on a website with kirby, and previously was able to launch and access the site at both localhost:8000 and my IP address (e.g., XXX.XX.XX.XX:8000) by running the terminal command php -S localhost:8000 kirby/router, and similarly for the IP.

However, recently I tried to launch my site at my IP address again, and now when I visit it, the site displays this error:

**Warning** : Unknown: Failed to open stream: No such file or directory in **Unknown** on line **0**

**Fatal error** : Failed opening required 'kirby/router' (include_path='.:/opt/homebrew/Cellar/php/8.4.3/share/php/pear') in **Unknown** on line **0**

I’m still able to visit the site when it’s launched at localhost:8000, and I have another Kirby project that I am able to visit at the IP:8000. Does anyone know why this could be happening? I checked my router.php in my kirby folder and it hasn’t changed.

I dont know whats going on there but I would recommend using Herd as a local server rather then the built in PHP server as it makes it much easier to work with multiple sites, and multiple versions of PHP. You can even set a different version of PHP to each site if you need to.

Testing locally with a starter kit:

  • php -S localhost:8000 kirby/router.php works
  • php -S localhost:8000 kirby/router doesn’t (indeed, such a file doesn’t exist at ./kirby/router)

(If you’re installing Kirby with Composer and not using the Kirby composer installer plugin, the path should be vendor/getkirby/cms/router.php.)

Thank you both for your replies!! It turns out @fvsch had the fix — I just needed to add .php to my command. :sweat_smile: