Got PHP/Apache going OK, however doesn't want to start Grav from my sites folder?

Hi

I’ve got php 7.3.11 up and running and it’s serving basic/‘Hello World’ php scripts perfectly well from my Sites folder.

I downloaded grav and unzipped it in my Sites folder. I went to a browser and entered - http://localhost/grav-admin/index.php

And this is what came back:—

Fatal error : Uncaught RuntimeException: Failed to save file /Users/simonloveland/Sites/grav-admin/user/config/security.yaml in /Users/simonloveland/Sites/grav-admin/vendor/rockettheme/toolbox/File/src/AbstractFile.php:369 Stack trace: #0 /Users/simonloveland/Sites/grav-admin/system/src/Grav/Common/Config/Setup.php(405): RocketTheme\Toolbox\File\AbstractFile->save() #1 /Users/simonloveland/Sites/grav-admin/system/src/Grav/Common/Config/Setup.php(290): Grav\Common\Config\Setup->check(Object(RocketTheme\Toolbox\ResourceLocator\UniformResourceLocator)) #2 /Users/simonloveland/Sites/grav-admin/system/src/Grav/Common/Service/ConfigServiceProvider.php(39): Grav\Common\Config\Setup->init() #3 /Users/simonloveland/Sites/grav-admin/vendor/pimple/pimple/src/Pimple/Container.php(118): Grav\Common\Service\ConfigServiceProvider->Grav\Common\Service{closure}(Object(Grav\Common\Grav)) #4 /Users/simonloveland/Sites/grav-admin/system/src/Grav/Common/Grav.php(203): Pimple\Container->offsetGet(‘setup’) #5 /Users/simonloveland/Sites/grav-adm in /Users/simonloveland/Sites/grav-admin/system/src/Grav/Common/Config/Setup.php on line 409

Is the last line ‘Config/Setup.php’ on line 409 where I need to make some changes?

I’ve been through the install guides but I haven’t been able to see what I’ve done wrong/not done in the first instance…

Any help greatly appreciated

Regards

SimonLove

Failed to save file usually means a permissions issue

Thanks for replying. Would you have any idea how to resolve this? Which folder’s permissions would I have to change?

Hi @SimonLove , if you have not already seen this docs page perhaps it might be of help? Permissions | Grav Documentation

Thanks for replying.

Yes I have seen the Permissions | Grav Documentation

I’ve tried changing the permissions on a few folders but it’s not fixed it. I’m close to giving up, because I don’t know what the problem is? It’s a shame because I really wanted to use Grav, but I can’t seem to fix the problem?

Simon

@SimonLove, You might give the following a try in the root of Grav folder:

$ chcon -Rv --type=httpd_sys_rw_content_t .

I have no idea what it does, but if it works, you might consider adding a “thank you” to this post on Github.

Thanks I tried it, but Unix said - command not found. I’ve just upgraded my Unix to run a different shell so it probably doesn’t recognise that command. Thanks anyway.

Simon

What unix / linux are you currently running ? what is your hardware pc / mac

Are you command line based or GUI ?

When you ran the hello world script, what directory did you save and run that from ?

Do you have any other sites connected to localhost ? Do they run ?

Have you tried just http://localhost/grav-admin/ , does that produce the same result
what result do you get if you do ls -l /Users/simonloveland/Sites/grav-admin/

finally taken from this page
Installation | Grav Documentation (getgrav.org)

In terminal and in the grav-admin directory
php -v
then
php -S localhost:8000 system/router.php

It Is not good but you could do

sudo chmod +r 777 /Users/simonloveland/Sites/grav-admin/ as a last resort just to see if it will run.

Thanks for that - I tried - php -S localhost:8000 system/router.php and it although it didn’t bring up the Grav Welcome Page, it did say what’s wrong - apparently the PHP Zip extension is required but not installed

I did a look up on google and some grav users were discussing this - One guy had the same problem - No php Zip extension - the other users were suggesting all sorts of solutions - none of them seem to work…

Do you know how I can install the PHP Zip extension?

I really don’t know how people can claim Grav is easy to install - It is the MOST awkward CMS to install I’ve EVER encountered…

@SimonLove , the issue is actually not a grav one but more of a php issue
Requirements | Grav Documentation (getgrav.org)

Standard php doesnt have all the modules loaded, so you need to edit the php.ini which lives in the php directory and simple enabled the following php modules.

curl
ctype
dom
gd
json
mbstring
openssl
session
simplexml
xml
zip

openssl
yaml

Requirements | Grav Documentation , use your text editor and simply scroll down the list and remove the semi-colons to enable the php modules which match the list above.

:slight_smile:

this page which is unbuntu also may help if the module is not installed and you need to “get” it

How To Install PHP Modules on Ubuntu 20.04 | 18.04 (brightwhiz.com)

Thanks for that. That makes a lot of sense. I’m going to try it tomorrow when I’m sober and see if it works…

Once again, thanks very much for all your help.

Simon