macopedia / magmi-m2

Magmi GitHub, see branch magento2 for a version compatible with Magento 2
113 stars 53 forks source link

404 /magmi/web/magmi.php Magento 2.4 #86

Open JosephGourvenec opened 4 years ago

JosephGourvenec commented 4 years ago

Hi Guys,

I've tried and tried to get this working, searched and read every post about this 404 issue.

I'm hoping this is something you can advise and clear up why please and what needs to happen to make it work.

In my dev site visiting /magmi/web/magmi.php it always 404's

I've updated the nginx.conf.simple file with the below and other versions of the below from alternate sources

location ~ /magmi/(.*) { root $MAGE_ROOT;

root /home/storm/sites/example.com/magmi;

try_files /web/$1 /web/$1/;
location ~ ^/magmi/(.*\.php)$ {
    try_files /web/$1 =404;
    fastcgi_pass   unix:/var/run/php-fpm/php-fpm-EXAMPLE.com.sock;
    fastcgi_index  index.php;
    fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
    fastcgi_param  PHP_FLAG  "session.auto_start=off \n #suhosin.session.cryptua=off";
    #fastcgi_param  PHP_VALUE "memory_limit=2G \n max_execution_time=3600";
    fastcgi_read_timeout 3600s;
    fastcgi_connect_timeout 3600s;
    include fastcgi_params;
}

}

Cheers, Joe

JosephGourvenec commented 4 years ago

Hi again,

To add I've also tried both snippets from https://github.com/macopedia/magmi-m2/issues/23 too and also don't work "https://github.com/macopedia/magmi-m2/issues/23"

Cheers, Joe

dvershinin commented 3 years ago

If you install Magmi using composer, then ensure proper path to it, e.g.:

location /magmi/ {
    auth_basic off;
    alias /srv/www/example.com/vendor/macopedia/magmi2/magmi/web/;
    location ~ \.php$ {
        fastcgi_pass   unix:/var/run/php-fpm/php-fpm-example.com.sock;
        fastcgi_index  index.php;
        # fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        # $request_filename makes more sense in combination with alias
        fastcgi_param SCRIPT_FILENAME $request_filename;
        fastcgi_param  PHP_FLAG  "session.auto_start=off \n suhosin.session.cryptua=off";
        fastcgi_param  PHP_VALUE "memory_limit=2G \n max_execution_time=3600";
        fastcgi_read_timeout 3600s;
        fastcgi_connect_timeout 3600s;
        include fastcgi_params;
    }
}

In my dev site visiting /magmi/web/magmi.php it always 404's

With any of the above configs, the proper URI is /magmi/magmi.php (without web).