0

I can't start installation from the browser. When i visit /kagneto/setup i get a 500 error.

Created permissions set per the docs. The filesystem user is someuser and has groups someuser apache.

someuser@localhost $ groups
someuser www-data

The following are the permissions of the directory getting the error:

[someuser@localhost kagento]# ls -al /var/www/html/kagento/var/
total 8
drwxrws---.  5 someuser apache   73 Jan 14 10:23 .
drwxrwx---. 14 someuser apache 4096 Jan 14 09:35 ..
drwxrws---.  3 someuser apache   36 Jan 14 10:21 composer_home
-rwxrwxrwx.  1 someuser apache  126 Jan 14 09:35 .htaccess
drwxrws---.  2 someuser apache   23 Jan 14 10:22 log
drwxrws---.  3 someuser apache   23 Jan 14 10:22 page_cache

I'm getting the following error:

PHP Fatal error:  Uncaught kagento\\Framework\\Exception\\FileSystemException: Directory "/var/www/html/kagento/var/cache/" cannot be created Warning!mkdir(): Permission denied in /var/www/html/kagento/vendor/kagento/framework/Filesystem/Driver/File.php:226\nStack trace:\n#0 /var/www/html/kagento/vendor/kagento/framework/Filesystem/Driver/File.php(200): kagento\\Framework\\Filesystem\\Driver\\File->mkdirRecursive('/var/www/html/m...', 511)\n#1 /var/www/html/kagento/vendor/kagento/framework/Filesystem/Directory/Write.php(93): kagento\\Framework\\Filesystem\\Driver\\File->createDirectory('/var/www/html/m...', 511)\n#2 /var/www/html/kagento/vendor/kagento/framework/App/Cache/Frontend/Factory.php(294): kagento\\Framework\\Filesystem\\Directory\\Write->create()\n#3 /var/www/html/kagento/vendor/kagento/framework/App/Cache/Frontend/Factory.php(132): kagento\\Framework\\App\\Cache\\Frontend\\Factory->_getBackendOptions(Array)\n#4 /var/www/html/kagento/vendor/kagento/framework/App/Cache/Frontend/Pool.php(67): kagento\\Framework\\App\\Cache\\Frontend\\Factory->create in /var/www/html/kagento/vendor/kagento/framework/Filesystem/Driver/File.php on line 226

While posting, i had the following stackexchange error:

Body cannot contain "kagneto". This is a site for kagento, not an X-Men character. ;-)

Replace k with m for the above. Is this a joke? I had to rename the directories just to post the output.

0

You'd need to add your current user to the same group with apache

sudo usermod -aG apache someuser

Then

sudo chgrp apache /var/www/html/kagento
sudo chmod -R g+rwx /var/www/html/kagento

Set permission for magento project

cd /var/www/html/kagento
sudo find . -type f -exec chmod 644 {} \;
sudo find . -type d -exec chmod 755 {} \;
sudo find ./var -type d -exec chmod 777 {} \;
sudo find ./pub/media -type d -exec chmod 777 {} \;
sudo find ./pub/static -type d -exec chmod 777 {} \;
sudo chmod -R 777 ./app/etc;
sudo chmod -R 777 var/;
sudo chmod -R 777 pub/static;
sudo chmod -R 777 generated;
sudo chmod 644 ./app/etc/*.xml;
sudo chown -R :apache .;
sudo chmod u+x bin/magento;
3
  • Thanks for the post. I've done that and set permissions per docs. Output for "someuser" has groups: "someuser apache". This problem is only on CentOS7 machine. I don't have this problem doing a fresh install on Ubuntu.
    – jtlindsey
    Jan 15 '19 at 15:55
  • "www-data" is for Ubuntu not CentOS. Looks like your reference is from a Ubuntu installation. The magento docs are correct for Ubuntu installation (different than what you posted).
    – jtlindsey
    Jan 15 '19 at 16:10
  • @learnsomemore Updated the answer Jan 16 '19 at 3:55

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.