rockettheme / toolbox

RocketTheme\Toolbox package contains a set of reusable PHP interfaces, classes and traits.
MIT License
21 stars 16 forks source link

Failed to save blueprint file by toolbox #26

Closed nitmws closed 5 years ago

nitmws commented 5 years ago

I run Grav 1.6.8 on a Ubuntu 18.04 server with Apache 2.4. After installing Grav and the Quark Open Publishing theme I get this error with any bin/gpm command:

PHP Fatal error:  Uncaught RuntimeException: Failed to save file WEBROOT/cache/compiled/blueprints/master-localhost.php in WEBROOT/vendor/rockettheme/toolbox/File/src/File.php:351
Stack trace:
#0 WEBROOT/vendor/rockettheme/toolbox/File/src/PhpFile.php(31): RocketTheme\Toolbox\File\File->save(Array)
#1 WEBROOT/system/src/Grav/Common/Config/CompiledBase.php(252): RocketTheme\Toolbox\File\PhpFile->save(Array)
#2 WEBROOT/system/src/Grav/Common/Config/CompiledBase.php(117): Grav\Common\Config\CompiledBase->saveCompiledFile('/var/www/produs...')
#3 WEBROOT/system/src/Grav/Common/Service/ConfigServiceProvider.php(77): Grav\Common\Config\CompiledBase->load()
#4 WEBROOT/system/src/Grav/Common/Service/ConfigServiceProvider.php(36): Grav\Common\Service\ConfigServiceProvider::blueprints(Object(Grav\Common\Grav))
#5 /var/www/produsr1/foto.metadate in WEBROOT/vendor/rockettheme/toolbox/File/src/File.php on line 351

The WEBROOT/cache/compiled/blueprints folder holds already a file saved while installing Grav. Owner of the folder is the usual www-data. As this stops any further action using bin/gpm I can't use Grav at all.

mahagr commented 5 years ago

Try running CLI with: sudo -u www-data bin/gpm [...].

You need to use the same user as apache in CLI. :)

nitmws commented 5 years ago

This worked. Unfortunately this requirement is not mentioned in the Grav CLI documentation.

rhukster commented 5 years ago

we're going to add it to documentation...