I am stuck in the installation of new copy of Magento 2.1.3. I downloaded tar.bz2 archive from the site into the apache root folder of my CentOS 7 machine. I extracted it with the command

tar jxf Magento-CE-2_1_3_tar_bz2-2016-12-13-09-10-13.tar.bz2

when I was logged as the root user. Then I executed the permissions commands as Magento dev docs suggests:

find var vendor pub/static pub/media app/etc -type f -exec chmod u+w {} \;
find var vendor pub/static pub/media app/etc -type d -exec chmod u+w {} \;
chmod u+x bin/magento

Then, I finally navigated to http://mycentosurl/magento2, but what I get is not the wizard installation but this error:

Uncaught exception 'Magento\Framework\Exception\FileSystemException' with message 'The file "/var/www/html/magento2/var/.regenerate" cannot be deleted

What am I doing wrong?

2 Answers 2


Did you set the permissions while being logged in as root? Which user is your apache running with? If www-data is the user apache is using, it doesn't seem to have necessary permissions on var.

If it's just your local installation, you can do the following as root user in apache basedir:

chmod uog+rwx var pub/static pub/media
chown www-data:www-data var pub/static pub/media

This makes the necessary folders globally accessible. For the second line you need to know the user apache is running with. The example above is the default setting of apache. Don't use these settings in production.


You can always try CLI Installation:

From your Magento's root directory execute:

php -f bin/magento setup:install --base-url="http://www.example.com/" --db-name="my_db_name" --db-host="localhost" --db-user="my_db_user" --db-password="my_db_password" --backend-frontname="admin" --admin-firstname="Admin" --admin-lastname="Admin" --admin-email="[email protected]" --admin-user="myadmin" --admin-password="myadmin_password" --language="en_US" --currency="EUR" --timezone="Europe/Athens" --use-rewrites="1" --session-save="db"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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