PhileCMS / Phile

A flat file CMS with a swappable parser and template engine.
https://philecms.github.io/
Other
257 stars 49 forks source link

unlink(/var/www/phile/content/setup.md): Permission denied in /var/www/phile/lib/Phile/Core.php ... #263

Closed ambein closed 9 years ago

ambein commented 9 years ago

Final stage of Phile installation resulted in this error. These were the steps taken to install Phile on my machine:

  1. Copied and unziped Phile:

    sudo wget “https://github.com/PhileCMS/Phile/releases/download/1.5.2/Phile.zip” mkdir phile cd phile sudo unzip /var/www//Phile.zip

  2. View Phile root page in web browser, returned:

    Sorry, Please create /var/www/phile/lib/cache//132206196163/ and SET Mode 0777 or any Writable Permission!

  3. Changed permission in the phile/lib/cache/ folder (change to 775 did not work, resulted in same error message above, in 2.). This solution was found in resolution of issue 37

    sudo chmod 777 phile/lib/cache

  4. View Phile root page on web browser, showed setup.md page, hooray!
  5. Opened generator.php file, copied key, and pasted in config.php (saved changes), then reloaded root page, got error handler, with the error:

[2] unlink(/var/www/phile/content/setup.md): Permission denied in /var/www/phile/lib/Phile/Core.php on line 148 [2] (Exception-Wiki) Exception thrown in file /var/www/phile/plugins/phile/errorHandler/Classes/Development.php on line 32.

error in detail

The usual welcome page content followed this content, although the layout was messed up by the error handler.

The files and folders in the Phile directory are generally owned by root with no group (root) and other with read-only rights, for example:

  1. In the root directory of Phile: permissions
  2. In the phile/content/ directory (where setup.md is located): permissions content
  3. In the phile/lib/Phile/ directory (where Core.php is located): permissions lib phile
ambein commented 9 years ago

Simply deleting setup.md manually resolved the issue. However I suspect my permissions are wrong but I don't know what the appropriate owner or group would be, if that is indeed the issue. Any guidance would be appreciated, as I can't find any documentation on what the appropriate ownership and rights structure should be. Thanks!

james2doyle commented 9 years ago

Hey there, you can read the installation wiki for more instructions. You can see the post-installation directions ask the user to change the permissions https://github.com/PhileCMS/Phile/wiki/%5BHOW-TO%5D-Installation#post-installation

ambein commented 9 years ago

Thanks! Did it, this will likely solve all my problems... haven't had any new problems. Perhaps this should have been done right after unzipping the files? For some reason I didn't see this section or was following the installation summary on another page. When I have a chance I'll restart from the beginning and see if it avoids the problems I found along the way.

Schlaefer commented 9 years ago

The setup.md won't be a problem in 1.6. Incorporating #247 we don't have to delete it anymore.

With regard to permissions on the cache directory: maybe the setup check should test if the cache and persistent storage folders are writable and report if they are not?