5

I am trying to install a magento 2 on an OVH shared hosting with a private sql server. I copied a magento 2 new package and I am currently encountering the following error when trying to launch the setup :

http://xxxxxx/setup/index.php/navigation Failed to load resource: the server responded with a status of 404 (Not Found)
http://xxxxxx/setup/index.php/navigation/side-menu Failed to load resource: the server responded with a status of 404 (Not Found)
http://xxxxxx/setup/index.php/navigation/header-bar Failed to load resource: the server responded with a status of 404 (Not Found)

Then after some time waiting on the page i get this :

angular.js:7715 POST http://xxxxxx/setup/index.php/session/prolong 404 (Not Found)

The setup works fine in local, what should I do ?

It isn't a Symlink error, I already modified the "virtualType name="developerMaterialization" section, and deleted files under pub/static.

My errors are angular.js errors.

enter image description here

7
  • 3
    Possible duplicate of Magento 2 404 error for scripts and css
    – MagenX
    Commented May 10, 2016 at 19:36
  • No, this is a different error and the fixes of your topic didn't work for me.
    – Malcom
    Commented May 11, 2016 at 10:53
  • Did you check if file permissions are as recommended? Looks like setup folder is not readable by webuser.
    – Maddy
    Commented May 11, 2016 at 20:44
  • I changed file permissions as recommended and it is still not working.
    – Malcom
    Commented May 19, 2016 at 14:06
  • Any help would be appreciated please
    – Malcom
    Commented May 22, 2016 at 20:31

2 Answers 2

10

I fix this by the https://github.com/magento/magento2/issues/2504#issuecomment-159663316

Here is the code

  1. My nginx site config

    upstream fastcgi_backend {
        server unix:/var/run/php/php7.0-fpm.sock;
    }
    
    server {
        listen 80;
        server_name YOUR_IP_OR_DOMAIN_NAME;
        set $MAGE_ROOT YOUR_MAGENTO_FILE_PATH;
        set $MAGE_MODE developer;
        include YOUR_MAGENTO_FILE_PATH/nginx.conf.sample;
    }
    

2.Modify the nginx.conf.sample file

    location /setup {
        root $MAGE_ROOT;

        location ~ ^/setup/index.php {

            ### This fixes the problem:
            fastcgi_split_path_info ^(.+?\.php)(/.*)$;
            ################################

            fastcgi_pass   fastcgi_backend;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            include        fastcgi_params;
        }

    }
  1. Open th url in the browser

    http://YOUR_IP_OR_DOMAIN_NAME/setup

3
  • Hi, Wen Wei, I tried using your solution. and it worked perfectly in my Magento 2.1.8 using nginx. Thanks again Commented Sep 15, 2017 at 17:03
  • This is the problem. I wonder what a buggy thing. Commented Oct 5, 2018 at 19:18
  • Restart nginx after making this change. sudo service nginx restart
    – Nahid
    Commented Nov 18, 2018 at 0:42
0

I understand your situation so here is my solution form magento installation virtualhost for nginx.

  1. Just u have to change php-fpm address according to your configuration

  2. Set mage_root according to your magento installation folder.

  3. Comment the cgi.fix_pathinfo=0 by ;cgi.fix_pathinfo=0

  4. Also php-fpm config file www.conf must have user nginx like
    user = nginx
    group = nginx
    listen.owner = nginx
    listen.group = nginx
    listen.mode = 0660

  5. You php session dir must have ownership of nginx.

  6. Here is Nginx VirtualHost Configuration file for magento2:> If u dont understand download this clean text file from this link.... https://drive.google.com/file/d/1MI0JKx5Gx_dLFz2c6fyubgpSmM_TESux/view?usp=sharing Download VirtualHost file

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.