I have installed Magento 2.3.5-p1 and also tried 2.3.4-p2 on Centos 7, with Nginx & PHP-FPM, maria DB with following commands.

1. /var/www/magento < owner by MAGENTO:NGINX user (I have created a pool for magento:nginx)
2. find var generated vendor pub/static pub/media app/etc -type f -exec chmod g+w {} +
3. find var generated vendor pub/static pub/media app/etc -type d -exec chmod g+ws {} +
4. chmod u+x bin/magento
6. su magento

7.  bin/magento setup:install --base-url='https://www.example.com/' \
--base-url-secure='https://www.example.com/' \
--backend-frontname='' \
--db-host='localhost' --db-name='' --db-user='' \
--db-password='' --admin-firstname='example' \
--admin-lastname='Admin' --admin-email='' \
--admin-user='admin' --admin-password='' --language='en_US' \
--currency='USD' --timezone='UTC' --use-rewrites=1 --use-secure-admin=1 --use-secure=1

Once completed, my FRONTEND (home page) works absolutely fine, i just have 2 errors in the javascript console log:

[Error] Failed to load resource: the server responded with a status of 404 () (requirejs-config.js, line 0)
[Error] Refused to execute https://www.example.com/pub/static/version1594092941/frontend/Magento/luma/en_US/requirejs-config.js as script because "X-Content-Type: nosniff" was given and its Content-Type is not a script MIME type.

But when I open admin panel, I can login into it. However, after logging in it keeps loading. I have tried several methods available online such as:

1. rm -rf pub/static/* (except .htaccess) refresh page
php bin/magento cache:clean
php bin/magento cache:flush
php bin/magento setup:upgrade
php bin/magento setup:di:compile
vi app/etc/di.xml <-- Change Symlink to Copy
rm -rf pub/static/*
refresh page
rm -rf var/*
bin/magento setup:static-content:deploy -f
bin/magento c:c
5. bin/magento cache:enable

I have tried to install it under both php-fpm and nginx group, also as nginx:nginx. Nothing works, admin panel just keeps loading.

What am I missing here?

The errors i get on admin panel JS console logs

enter image description here


just run this commands it will solve your isssue

php bin/magento config:set web/secure/use_in_adminhtml 1

Alright after days of troubleshooting I finally found the stupid issue that was related to open_basedir. However, i still don't know why that (Home Page) worked fine even when open_basedir in PHP was in affect. But only admin panel wasn't working.

So I disabled open_basedir in php.ini and reinstalled Magento 2, and I no longer had this issue.

$ vi /etc/php.ini


$ systemctl restart php-fpm

$ bin/magento setup:install --.....


It may be permission issues.

sudo chmod -R 0777 var/ pub/ generated/
  • giving 777 permission is a not a recommended solution. however, you can and should give r/w permission to that specific user/group only e.g. 770. however my problem was with the open_basedir. – nix Jul 13 '20 at 4:54

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.