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

Magento 2 filesystem permissions and freezing upgrading workarounds #3193

Closed
IceReaper opened this issue Jan 29, 2016 · 2 comments
Closed

Magento 2 filesystem permissions and freezing upgrading workarounds #3193

IceReaper opened this issue Jan 29, 2016 · 2 comments

Comments

@IceReaper
Copy link

I just wanted to share some shellscripts which keep saving my life regarding some problems with permissions and upgrading.

First of all the upgrade process starts with upgrading the composer.json, and then dies after purging some stuff in the vendor folder. resulting in the updater not doing anything at this point.
The workaround for this is to do the composer update manualy and remove the lock file, so the updater will continue.

composer update && rm var/.update_in_progress.flag

The second problem lies within magentos default permission setup, which does not work on a lot of shared hosters. Its just too strict to allow the webserver to access the files. As a result to the update procedure, i need to re-run this lines after every update.

sed -i 's/0640/0664/g' vendor/magento/module-deploy/Model/Filesystem.php
sed -i 's/0750/0775/g' vendor/magento/module-deploy/Model/Filesystem.php
sed -i 's/0660/0664/g' vendor/magento/framework/Filesystem/DriverInterface.php
sed -i 's/0770/0775/g' vendor/magento/framework/Filesystem/DriverInterface.php

The next problem is that files written between the update process and the permission modifications now have the wrong permissions set. This can be fixed with the following command:

find . -type f -exec chmod 664 {} \; && find . -type d -exec chmod 775 {} \; && chmod +x bin/magento
@vrann
Copy link
Contributor

vrann commented Mar 8, 2016

@IceReaper Thanks for sharing! I believe these issues are captured and tracked under #2412 and Magento team currently works on those.

I'm closing current issue because there is nothing required to be done, I hope it will be searchable anyway.

@vrann vrann closed this as completed Mar 8, 2016
@tdgroot
Copy link
Member

tdgroot commented Mar 10, 2016

Created a simple bash script which gets loaded in .bashrc. Thought I'd share it here..

 #!/bin/bash

 function fixmagento2permissions {
     if [ -d vendor ]
     then
         sed -i 's/0640/0664/g' vendor/magento/module-deploy/Model/Filesystem.php
         sed -i 's/0750/0775/g' vendor/magento/module-deploy/Model/Filesystem.php
         echo "Set permissions in" $(pwd)"/vendor/magento/module-deploy/Model/Filesystem.php"
         sed -i 's/0660/0664/g' vendor/magento/framework/Filesystem/DriverInterface.php
         sed -i 's/0770/0775/g' vendor/magento/framework/Filesystem/DriverInterface.php
         echo "Set permissions in" $(pwd)"/vendor/magento/framework/Filesystem/DriverInterface.php"
     else
         echo "Directory" $(pwd)"/vendor/ not found"
     fi
 }

magento-engcom-team pushed a commit that referenced this issue Oct 9, 2018
[pangolin] MQE-1139: Cleanup test modules in dev/tests/acceptance in 2.3-develop & 2.2-develop, CE & EE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants