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.

7ochem
  • 7,532
  • 14
  • 51
  • 80
Remy
  • 21
  • 1
  • 1
  • 2

3 Answers3

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.

Hidden Dragon
  • 101
  • 1
  • 5
  • 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 02: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.

Sigismund
  • 183
  • 1
  • 9
  • It first worked for me to, but trust me i tried it all.[http://magento.stackexchange.com/questions/91870/magento-2-folder-file-permissions] did work but now its just stuck at this error. – Remy Apr 01 '16 at 08:39
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.

Key Shang
  • 3,415
  • 32
  • 58