Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fatal error: Uncaught Runtime Exception #912

Closed
elporfirio opened this issue Jun 21, 2016 · 10 comments

Comments

@elporfirio
Copy link

commented Jun 21, 2016

Fatal error: Uncaught RuntimeException: Opening file for writing failed on error fopen(/var/www/html/music/grav/user/config/security.yaml): failed to open stream: Permission denied in /var/www/html/music/grav/vendor/rockettheme/toolbox/File/src/File.php:202 Stack trace: #0 /var/www/html/music/grav/vendor/rockettheme/toolbox/File/src/File.php(316): RocketTheme\Toolbox\File\File->lock() #1 /var/www/html/music/grav/system/src/Grav/Common/Config/Setup.php(250): RocketTheme\Toolbox\File\File->save(Array) #2 /var/www/html/music/grav/system/src/Grav/Common/Config/Setup.php(175): Grav\Common\Config\Setup->check(Object(RocketTheme\Toolbox\ResourceLocator\UniformResourceLocator)) #3 /var/www/html/music/grav/system/src/Grav/Common/Grav.php(213): Grav\Common\Config\Setup->init() #4 /var/www/html/music/grav/index.php(38): Grav\Common\Grav->process() #5 {main} thrown in /var/www/html/music/grav/vendor/rockettheme/toolbox/File/src/File.php on line 202

Apache Server
Server version: Apache/2.4.6 (Red Hat Enterprise Linux)
Server built: Mar 21 2016 02:33:00

PHP Version
$ php -v
PHP 7.0.7 (cli) (built: May 28 2016 07:53:22) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies

Permissions
sudo chown -R apache:apache music/

tried all into https://learn.getgrav.org/troubleshooting/permissions

Grav version
You are already running the latest version of Grav (v1.0.10) released on Thu Feb 11 22:37:50 2016

Main Folder
var/www/html/music

Install intents

  • Zip + Composer install
  • Composer install
  • Git + Composer Install

Any Help Please??

@flaviocopes

This comment has been minimized.

Copy link
Contributor

commented Jun 21, 2016

Grav cannot write to the /var/www/html/music/grav/user/config/ folder, so as you already guessed it's a permission issue.

Your permissions settings seem ok, if PHP is run as apache:apache

@elporfirio

This comment has been minimized.

Copy link
Author

commented Jun 21, 2016

yes it does;

<?php echo exec('whoami');

throws: apache

Extra info:

music folder
drwxrwxr-x. 3 apache apache 33 Jun 21 08:10 music

music/user/config
drwxrwxr-x. 2 apache apache 40 Jun 21 08:10 config

@flaviocopes

This comment has been minimized.

Copy link
Contributor

commented Jun 21, 2016

I'm afraid I don't have an answer for this then. Searching on the Grav forum didn't bring up past occurrences of this problem

@rhukster rhukster added the question label Jun 21, 2016

@elporfirio

This comment has been minimized.

Copy link
Author

commented Jun 22, 2016

FIXED !! 💃

The problem was SELinux, I ran this command

chcon -Rv --type=httpd_sys_rw_content_t . Into my Grav Folder.

references:

I love GRAV 🍡 PS. I´m on EC2 Instance 👍

@elporfirio elporfirio closed this Jun 22, 2016

@w00fz

This comment has been minimized.

Copy link
Member

commented Jun 22, 2016

Nice, I never knew about the chcon command until now.

@flaviocopes

This comment has been minimized.

Copy link
Contributor

commented Jun 22, 2016

@elporfirio care to add a line to https://learn.getgrav.org/troubleshooting/permissions about this? So others on SELinux with this same issue will find a quick answer

@elporfirio

This comment has been minimized.

Copy link
Author

commented Jun 22, 2016

@flaviocopes no problem, I'll document this.

@lokeshh

This comment has been minimized.

Copy link

commented Feb 16, 2017

Somebody please document it. It was really frustrating solving this issue.

@flaviocopes

This comment has been minimized.

Copy link
Contributor

commented Feb 17, 2017

@Zygodcatyl

This comment has been minimized.

Copy link

commented Feb 18, 2018

Thank you, I was banging my head against a wall trying to figure this one out. I wonder why chmod and chown did not work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.