Running grav after installation in root web folder

Hello all,

I’m a newbie to all this but motivated to get things working! Please talk to me in newbie language :wink:

I am on a mac and have downloaded grav and copied the intire folder (it didn’t seem to be a zip file as described in the documentation) to my root web folder. When type in my browser: http://localhost/grav/ I get a 404.

How do I run grav?

On I followed the instructions for option 1, but when I get to ‘webserver’ I’m probably missing something.

Hope to get some help, thank you!!


Hi, it’s not a zip because Safari automatically uncompresses zip files.

I think your problem is that you moved the content of the Grav folder into the webserver root, but you missed a hidden file called .htaccess, which is not visible in Finder, but tells the webserver how to avoid those 404s.

Best way is to re-download Grav and move the whole folder, not the folders inside it, so the hidden file will be moved as well.

Thanks for your reply Flavio! But I did copy the whole folder, including the .htaccess file to the root folder. Anything else I could have done wrong?

go to your grav folder
open terminal
start php:
php -S localhost:8000 system/router.php
open your browser: http://localhost:8000/

thank you Arank, I opened the terminal and started php, it says:
“Listening on http://localhost:8000
Document root is /Users/Lotte”

Then clicked your link to open my browser, but it still won’t show me what I want:

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

Fatal error: Unknown: Failed opening required ‘system/router.php’ (include_path=’.:’) in Unknown on line 0

Sorry to be such a noob!

then your unzipped grav files have to be in /Users/Lotte
be sure that you open your terminal and start php in the right directory.
in your case in /Users/Lotte

you have to open your terminal and start php in your grav folder

Error you described is if you start php in the wrong folder with no grav files.

Step by Step:
Download grav and unzip it to a folder (maybe name it grav)

  1. navigate to your grav folder
  2. right clicking with your mouse should list an option: open terminal here (hope thats working on a mac)
  3. In your terminal type: php -S localhost:8000 system/router.php
    (should give you the correct grav path: maybe: /Users/Lotte/grav)
  4. in your webbrowser go to: localhost:8000/

so kind!! thanks.

Mac wouldn’t let me open the terminal from a specific location but it really did something in the terminal when I typed what you said. Now when I type in localhost:8000/ I get a different result:

“The requested resource / was not found on this server.”

  • mac doesn’t let you open a terminal in a specific path? really?
    if so you have to type in your correct grav path in step 3:
    maybe: /Users/Lotte/grav php -S localhost:8000 system/router.php
  • what is the terminal output after step 3 ?
  • try: localhost:8000 without the slash at the end

this afternoon I got:

“PHP 5.5.38 Development Server started at Sun Jun 18 16:11:33 2017
Listening on http://localhost:8000/Users/Lotte/Werk/web/grav/
Document root is /Users/Lotte
Press Ctrl-C to quit.”

Is that good? If I do it again I get:
"[Sun Jun 18 21:33:58 2017] ::1:51292 [404]: / - No such file or directory"

slash or no slash makes to difference in the browser address…

Sorry I’m hopeless aren’t I!

your grav files are in /Users/Lotte/Werk/web/grav

option 1:
in terminal: change directory to /Users/Lotte/Werk/web/grav
then type: php -S localhost:8000 system/router.php
open browser: localhost:8000
option 2:
in terminal type:
/Users/Lotte/Werk/web/grav php -S localhost:8000 system/router.php
open browser: localhost:8000

sorry forget my last post:
type in your browser:

Terminal listens, but when I go to localhost:800/users/etc (i type exactly what you typed and also tried the exact link Terminal gave me, and I get:

The requested resource /Users/Lotte/Werk/web/grav/ was not found on this server.

Maybe I should give up?:frowning:

Just to clear things up for me: At first I put the files on a remote web server by FTP, and tried to call this grav folder with my browser, but that was not correct and now I’m trying to call my local grav folder, is that correct?

localhost means your grav files have to be on your mac, not on a remote server.
so if you start php as described in step 3 your terminal should say:
Listening on http://localhost:8000
if your grav files are on a remote server you can’t access them in your browser with localhost

Then I understood that correctly, thanks. i also found the mac-way to open Terminal in a specific folder. I can start PHP in Terminal and it says:

Listening on http://localhost:8000
Document root is /Users/Lotte/Werk/web/grav

But whether I type in my browser

It doesn’t work…

Could the problem be that I downloaded GRAV and not GRAV + ADMIN? (I didn’t know which one too pick so I choose the simplest one)…

Because in the Grav folder I see no router.php

you don’t need admin.
what does your browser say if you call the address?

/Users/Lotte/Werk/web/grav folder is on your mac?
and all grav files are unzipped in that directory?
you can compare the files: