0

I'm attempting to setup a local development version of Magento 2. I'm importing the database from a currently running Magento installation. The site works correctly, but I'm unable to access the admin page.

I'm using PHP 7, Magento 2 and NGINX with the following configuration:

upstream fastcgi_backend {
  server  unix:/run/php/php7.0-fpm.sock;
}

server {
  listen 80;
  server_name magento.local;
  set $MAGE_ROOT /home/vagrant/Code/magento;
  include /home/vagrant/Code/magento/nginx.conf.sample;
  error_log  /var/log/nginx/magento.dev-error.log error;
  access_log /var/log/nginx/magento.dev-access.log;
}

The server returns 404 when visiting /admin (confirmed URL from php bin/magento info:adminuri)

There seems to be a fair few issues posted but I've yet to find a solution! Any advice would be greatly appreciated.

  • when you look into access log , what path nginx is trying to open? – MagenX Feb 3 '18 at 10:00
0

I am not an expert on vagrant. I have tried it in the past and I have had a lot of trouble. Do not get me wrong, the trouble might be operator error. I have setup Magento 2 on PHP7.0-fpm on digital ocean. I used this configuration: https://goo.gl/NPUiK4. You can also see the "How to Install Magento with Nginx on Ubuntu 16.04" tutorial on my favorite tutorial site: https://goo.gl/xfZJR4 (https://www.howtoforge.com/)

0

i recommend use docker, here a image to instant deployment:

https://github.com/fballiano/docker-magento2

I recommend disable cache's:

php -f bin/magento cache:flush
sudo rm -rf var/cache var/generation var/page_cache
php -f bin/magento cache:disable
php -f bin/magento setup:upgrade

And check our database table core_config_data and check if url is ok on web/unsecure/base_url and web/secure/base_url search for %cookie% and delete all rows.

Give right permissions to folders:

chmod -R 777 var
chmod -R 777 pub
chmod -R 777 generated

If nothing works then do this command on CLI:

php bin/magento setup:config:set --backend-frontname="admin_path"

Then use php bin/magento info:adminuri to check.

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.