2

I upgraded Magento 2 to Magento 2.0.3 today, everything went fine until I didn't get my webshop to work anymore with a lot of blank pages. Now I managed to get my pages to see errors again with the permissions set 644, 755 and var + pub + static folders are 777. Now that said I still get an error which is located in the lib/cache route here is the error:

a:4:{i:0;s:282:"Warning: file_put_contents(var/cache//mage-tags/mage---f56_CONFIG): failed to open stream: Permission denied in lib/internal/Cm/Cache/Backend/File.php on line 661";i:1;s:9007:"
#0 [internal function]: Magento\Framework\App\ErrorHandler->handler(2, 'file_put_conten...', '/home/smartphon...', 661, Array)
#1 lib/internal/Cm/Cache/Backend/File.php(661): file_put_contents('/home/smartphon...', 'f56_FRONTEND__R...', 10)
#2 lib/internal/Cm/Cache/Backend/File.php(174): Cm_Cache_Backend_File->_updateIdsTags(Array, Array, 'merge')
#3 vendor/magento/zendframework1/library/Zend/Cache/Core.php(390): Cm_Cache_Backend_File->save('a:0:{}', 'f56_FRONTEND__R...', Array, NULL)

It seems file.php can't write still while I changed every permission with permission owner and be on. I have no clue on what to do next. I cannot find it anywhere on the internet and never asked a question before so, here we go. Let's see if someone else manage to help me with this error.

  • Did one clean the cache? :D – Aivis Zvezdovs Mar 31 '16 at 18:37
  • There was some issue with the 2.0.3 patch; we're working on 2.0.4 right now. – Steve Johnson Mar 31 '16 at 22:28
  • @ Aivis: Yes i not only cleaned it, i deleted the var folder to let it be rebuild by the magento core. – Remy Apr 1 '16 at 8:43
  • @SteveJohnson: Oh if this is the case that could be the problem. I'l wait for the next update then and reverse my current then – Remy Apr 1 '16 at 8:43
  • @remy 2.0.4 is available now. You can try it anytime. – Steve Johnson Apr 2 '16 at 14:37
2

I got the same error just 20 minutes back from now. I had changed "var" folder permission to 777 and all files to 644 within this folder, after that i got that error. I tried changing the folder permission again but failed.

So i just deleted "var" folder/directory and replaced with the "var" folder only .htaccess file within it. And it worked for me.

  • Again i received same error, but this time removing everything under "var" directory except .htaccess files worked for me. – Hidden Dragon Jun 21 '16 at 2:44
0

I read that Fast-CGI requires different permissions (755,644), than those that Magento uses by default (775,660).

You can try changing all permissions by using following command

find . -type d -exec chmod 755 {} \; && find . -type f -exec chmod 644 {} \;

and changing permissions Magento will use in future, by editing

/vendor/magento/framework/Filesystem/DriverInterface.php 
/lib/internal/Cm/Cache/Backend/File.php 

I know it's not the prettiest solutions, but it worked for me.

0

If you set the permissions correctly, you could try below solution, it worked for me.

cd <your Magento install dir>
php bin/magento cache:flush

It seems old cache caused the problem, so what you need is to flush the cache.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.