Shopware 6 installation with shopware-installer.phar.php problem

Hi there!

I’m pretty new to this CMS but I want to explore it from the admin side.

I’m trying to install the shopware 6 via this instruction: Shopware 6 - First Steps - Installation

On server installed everything that is required by shopware:

php8.1 - with all the extensions it needs
Nginx
mariaDB
NodeJS18

Nginx configuration:

server {
#    listen 80;
    listen 40.118.124.129:80;
    index index.php index.html;
    server_name 40.118.124.129;

    client_max_body_size 32M;

    root /var/www/html/shopware;

    location /recovery/update/ {
        index index.php;
        try_files $uri /recovery/install/index.php$is_args$args;
    }

    location ~ ^/(recovery\/update\/index|index|shopware-installer\.phar)\.php(/|$) {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        include fastcgi.conf;
        fastcgi_param HTTP_PROXY "";
        fastcgi_buffers 8 16k;
        fastcgi_buffer_size 32k;
        proxy_connect_timeout 300s;
        proxy_send_timeout 300s;
        proxy_read_timeout 300s;
        send_timeout 300s;
        client_body_buffer_size 128k;
        fastcgi_pass unix:/run/php/php8.1-fpm.sock;
    }

    location = /sitemap.xml {
            log_not_found off;
            access_log off;
            try_files $uri /;
    }

    location = /robots.txt {
            log_not_found off;
            access_log off;
            try_files $uri /;
    }

    location ~* ^.+\.(?:css|cur|js|jpe?g|gif|ico|png|svg|webp|avif|html|woff|woff2|xml)$ {
        expires 1y;
        add_header Cache-Control "public, must-revalidate, proxy-revalidate";

        access_log off;

        # The directive enables or disables messages in error_log about files not found on disk.
        log_not_found off;

        tcp_nodelay off;

        ## Set the OS file cache.
        open_file_cache max=3000 inactive=120s;
        open_file_cache_valid 45s;
        open_file_cache_min_uses 2;
        open_file_cache_errors off;

        location ~* ^.+\.svg$ {
            add_header Content-Security-Policy "script-src 'none'";
        }
    }

    location / {
        try_files $uri /index.php$is_args$args;
    }
}

But for some reason when I try accessing the http://40.118.124.129/shopware/shopware-installer.phar.php
It doesn’t start the installation, it only download the file.

The only thing that I think is that in the instruction provided it’s setup with apache2 and .htaccess file. But I don’t see a reason why it wouldn’t work with nginx. But if that is the case please advise.

Or maybe I’m missing something?

Kindest regards and thank you in advanced!

Alex

You could try this example code:

# Enable Shopware 6.5 installer
location /shopware-installer.phar.php {
    try_files $uri /shopware-installer.phar.php$is_args$args;
}

# Run static files generated by shopware-installer.phar.php through PHP
location ~ ^/shopware-installer\.phar\.php/.+\.(?:css|js|png|svg|woff)$ {
     try_files $uri /shopware-installer.phar.php$is_args$args;
}

location /recovery/install {
    index index.php;
    try_files $uri /recovery/install/index.php$is_args$args;
}

location /recovery/update/ {
    if (!-e $request_filename){
        rewrite . /recovery/update/index.php last;
    }
}

location ~* ^.+\.(?:css|cur|js|jpe?g|gif|ico|png|svg|webp|htm|woff|woff2|xml)$ {
   expires 1y;
   add_header Cache-Control "public, must-revalidate, proxy-revalidate";

   access_log off;

   # The directive enables or disables messages in error_log about files not found on disk.
   log_not_found off;

   tcp_nodelay off;

   ## Set the OS file cache.
   open_file_cache max=3000 inactive=120s;
   open_file_cache_valid 45s;
   open_file_cache_min_uses 2;
   open_file_cache_errors off;

}

 location ~* ^.+\.svg$ {
       add_header Content-Security-Policy "script-src 'none'";
   }

    # Forward any not found file to index.php. Also allows to have beautiful urls like /homemade-products/
    location / {
        try_files $uri /index.php$is_args$args;
    }

   # Let php-fpm handle .php files
        location ~ \.php$ {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        include fastcgi.conf;
        fastcgi_param HTTP_PROXY "";
        fastcgi_buffers 8 16k;
        fastcgi_buffer_size 32k;
        fastcgi_read_timeout 300s;
        client_body_buffer_size 128k;
        fastcgi_pass unix:/run/php/php8.1-fpm.sock;
        http2_push_preload on;
    }
1 „Gefällt mir“

You will find the updated NGINX config in the developer docs.

We will also cover the NGINX config in the user docs soon :wave:

1 „Gefällt mir“

I have added the line below to my domain.conf file(Using Nginx and php-fpm), then the issue fixed now working fine

# Enable Shopware 6.5 installer
location /shopware-installer.phar.php {
    try_files $uri /shopware-installer.phar.php$is_args$args;
}
1 „Gefällt mir“