You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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:
Created a simple bash script which gets loaded in .bashrc. Thought I'd share it here..
#!/bin/bashfunctionfixmagento2permissions {
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"elseecho"Directory"$(pwd)"/vendor/ not found"fi
}
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.
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.
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:
The text was updated successfully, but these errors were encountered: