Magento安装重定向循环

Magento安装重定向循环,magento,nginx,php,magento-1.8,Magento,Nginx,Php,Magento 1.8,我试图用Nginx和php-fpm将Magento社区版安装到我的VPS(在Linode上),但我做不到。我将Magento 1.8.1.0下载到我的服务器。我创建了nginx配置,如。但当我请求我的域时,它会通过302头重定向到“/index.php/install/”路径,浏览器会给出无限循环错误 你能建议一个解决办法吗 编辑:我的nginx配置文件(我将真实域名替换为mydomain) 基本上,若您还并没有装箱的数据库,那个么在Nginx和虚拟主机配置中就会出现问题 可能的故障将出现在浏览

我试图用Nginx和php-fpm将Magento社区版安装到我的VPS(在Linode上),但我做不到。我将Magento 1.8.1.0下载到我的服务器。我创建了nginx配置,如。但当我请求我的域时,它会通过302头重定向到“/index.php/install/”路径,浏览器会给出无限循环错误

你能建议一个解决办法吗

编辑:我的nginx配置文件(我将真实域名替换为mydomain)


基本上,若您还并没有装箱的数据库,那个么在Nginx和虚拟主机配置中就会出现问题

可能的故障将出现在浏览器的内存中。尝试清理它,或者使用匿名机制

尝试删除magento文件并创建一个简单的index.php文件,其中包含“hello”文本。如果可行,请尝试再次将Magento文件复制到此文件夹并运行安装

请记住,您必须创建一个空数据库,并且用户拥有此数据库的所有权限


第二个问题可能是安装错误,(您的magento尚未安装,您试图再次连接安装程序,但这将重定向)。在这种情况下,如果安装中出现问题,请从数据库中删除表,然后再次运行安装。

基本上,如果您还没有装箱数据库,则Nginx和虚拟主机配置中会出现问题

可能的故障将出现在浏览器的内存中。尝试清理它,或者使用匿名机制

尝试删除magento文件并创建一个简单的index.php文件,其中包含“hello”文本。如果可行,请尝试再次将Magento文件复制到此文件夹并运行安装

请记住,您必须创建一个空数据库,并且用户拥有此数据库的所有权限


第二个问题可能是安装错误,(您的magento尚未安装,您试图再次连接安装程序,但这将重定向)。如果安装过程中出现问题,请从数据库中删除表,然后再次运行安装。

请检查您的htaccess文件。如果存在,请检查现有规则

请检查您的htaccess文件。如果存在,请检查现有规则

我的文件如下所示:

server {
    listen 80 default;
    access_log /var/log/nginx/test.ssl.access.log;
    error_log /var/log/nginx/test.ssl.error.log;
    ssl off;
    root /var/www/shop;
    server_name sales.test.net.au;
    location / {
        index index.html index.php;
        try_files $uri $uri/ @handler;
        expires 30d;
    }
    location ^~ /app/ { deny all; }
    location ^~ /includes/ { deny all; }
    location ^~ /lib/ { deny all; }
    location ^~ /media/downloadable/ { deny all; }
    location ^~ /pkginfo/ { deny all; }
    location ^~ /report/config.xml { deny all; }
    location ^~ /var/ { deny all; }
    location /var/export/ { ## Allow admins only to view export folder
        auth_basic "Restricted"; ## Message shown in login window
        auth_basic_user_file htpasswd; ## See /etc/nginx/htpassword
        autoindex on;
    }
    location /. { ## Disable .htaccess and other hidden files
        return 404;
    }
    location @handler { ## Magento uses a common front handler
        rewrite / /index.php;
    }
    location ~ .php/ { ## Forward paths like /js/index.php/x.js to relevant handler
        rewrite ^(.*.php)/ $1 last;
    }
    location ~ .php$ { ## Execute PHP scripts
        if (!-e $request_filename) { rewrite / /index.php last; }
        expires off; ## Do not cache dynamic content
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_param HTTPS $fastcgi_https;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param MAGE_RUN_CODE default;
        fastcgi_param MAGE_RUN_TYPE store;
        include fastcgi_params;
    }
    location /phpmyadmin {
               root /usr/share/;
               index index.php index.html index.htm;
               location ~ ^/phpmyadmin/(.+\.php)$ {
                       try_files $uri =404;
                       root /usr/share/;
                       fastcgi_pass 127.0.0.1:9000;
                       fastcgi_index index.php;
                       fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                       include /etc/nginx/fastcgi_params;
               }
               location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
                       root /usr/share/;
               }
        }
        location /phpMyAdmin {
               rewrite ^/* /phpmyadmin last;
        }
}
server {
    listen 443 default;
    ssl on;
    ssl_certificate /etc/nginx/ssl/server.crt;
    ssl_certificate_key /etc/nginx/ssl/server.key;
    access_log /var/log/nginx/test.ssl.access.log;
    error_log /var/log/nginx/test.ssl.error.log;
    server_name sales.test.net.au;
    root /var/www/shop;
    location / {
        index index.html index.php;
        try_files $uri $uri/ @handler;
        expires 30d;
    }
    location ^~ /app/ { deny all; }
    location ^~ /includes/ { deny all; }
    location ^~ /lib/ { deny all; }
    location ^~ /media/downloadable/ { deny all; }
    location ^~ /pkginfo/ { deny all; }
    location ^~ /report/config.xml { deny all; }
    location ^~ /var/ { deny all; }
    location /var/export/ { ## Allow admins only to view export folder
        auth_basic "Restricted"; ## Message shown in login window
        auth_basic_user_file htpasswd; ## See /etc/nginx/htpassword
        autoindex on;
    }
    location /. { ## Disable .htaccess and other hidden files
        return 404;
    }
    location @handler { ## Magento uses a common front handler
        rewrite / /index.php;
    }
    location ~ .php/ { ## Forward paths like /js/index.php/x.js to relevant handler
        rewrite ^(.*.php)/ $1 last;
    }
    location ~ .php$ { ## Execute PHP scripts
        if (!-e $request_filename) { rewrite / /index.php last; }
        expires off; ## Do not cache dynamic content
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_param HTTPS $fastcgi_https;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param MAGE_RUN_CODE default;
        fastcgi_param MAGE_RUN_TYPE store;
        include fastcgi_params;
    }
    location /phpmyadmin {
               root /usr/share/;
               index index.php index.html index.htm;
               location ~ ^/phpmyadmin/(.+\.php)$ {
                       try_files $uri =404;
                       root /usr/share/;
                       fastcgi_pass 127.0.0.1:9000;
                       fastcgi_index index.php;
                       fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                       include /etc/nginx/fastcgi_params;
               }
               location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
                       root /usr/share/;
               }
        }
        location /phpMyAdmin {
               rewrite ^/* /phpmyadmin last;
        }
}

为我工作…

我的文件如下所示:

server {
    listen 80 default;
    access_log /var/log/nginx/test.ssl.access.log;
    error_log /var/log/nginx/test.ssl.error.log;
    ssl off;
    root /var/www/shop;
    server_name sales.test.net.au;
    location / {
        index index.html index.php;
        try_files $uri $uri/ @handler;
        expires 30d;
    }
    location ^~ /app/ { deny all; }
    location ^~ /includes/ { deny all; }
    location ^~ /lib/ { deny all; }
    location ^~ /media/downloadable/ { deny all; }
    location ^~ /pkginfo/ { deny all; }
    location ^~ /report/config.xml { deny all; }
    location ^~ /var/ { deny all; }
    location /var/export/ { ## Allow admins only to view export folder
        auth_basic "Restricted"; ## Message shown in login window
        auth_basic_user_file htpasswd; ## See /etc/nginx/htpassword
        autoindex on;
    }
    location /. { ## Disable .htaccess and other hidden files
        return 404;
    }
    location @handler { ## Magento uses a common front handler
        rewrite / /index.php;
    }
    location ~ .php/ { ## Forward paths like /js/index.php/x.js to relevant handler
        rewrite ^(.*.php)/ $1 last;
    }
    location ~ .php$ { ## Execute PHP scripts
        if (!-e $request_filename) { rewrite / /index.php last; }
        expires off; ## Do not cache dynamic content
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_param HTTPS $fastcgi_https;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param MAGE_RUN_CODE default;
        fastcgi_param MAGE_RUN_TYPE store;
        include fastcgi_params;
    }
    location /phpmyadmin {
               root /usr/share/;
               index index.php index.html index.htm;
               location ~ ^/phpmyadmin/(.+\.php)$ {
                       try_files $uri =404;
                       root /usr/share/;
                       fastcgi_pass 127.0.0.1:9000;
                       fastcgi_index index.php;
                       fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                       include /etc/nginx/fastcgi_params;
               }
               location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
                       root /usr/share/;
               }
        }
        location /phpMyAdmin {
               rewrite ^/* /phpmyadmin last;
        }
}
server {
    listen 443 default;
    ssl on;
    ssl_certificate /etc/nginx/ssl/server.crt;
    ssl_certificate_key /etc/nginx/ssl/server.key;
    access_log /var/log/nginx/test.ssl.access.log;
    error_log /var/log/nginx/test.ssl.error.log;
    server_name sales.test.net.au;
    root /var/www/shop;
    location / {
        index index.html index.php;
        try_files $uri $uri/ @handler;
        expires 30d;
    }
    location ^~ /app/ { deny all; }
    location ^~ /includes/ { deny all; }
    location ^~ /lib/ { deny all; }
    location ^~ /media/downloadable/ { deny all; }
    location ^~ /pkginfo/ { deny all; }
    location ^~ /report/config.xml { deny all; }
    location ^~ /var/ { deny all; }
    location /var/export/ { ## Allow admins only to view export folder
        auth_basic "Restricted"; ## Message shown in login window
        auth_basic_user_file htpasswd; ## See /etc/nginx/htpassword
        autoindex on;
    }
    location /. { ## Disable .htaccess and other hidden files
        return 404;
    }
    location @handler { ## Magento uses a common front handler
        rewrite / /index.php;
    }
    location ~ .php/ { ## Forward paths like /js/index.php/x.js to relevant handler
        rewrite ^(.*.php)/ $1 last;
    }
    location ~ .php$ { ## Execute PHP scripts
        if (!-e $request_filename) { rewrite / /index.php last; }
        expires off; ## Do not cache dynamic content
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_param HTTPS $fastcgi_https;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param MAGE_RUN_CODE default;
        fastcgi_param MAGE_RUN_TYPE store;
        include fastcgi_params;
    }
    location /phpmyadmin {
               root /usr/share/;
               index index.php index.html index.htm;
               location ~ ^/phpmyadmin/(.+\.php)$ {
                       try_files $uri =404;
                       root /usr/share/;
                       fastcgi_pass 127.0.0.1:9000;
                       fastcgi_index index.php;
                       fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                       include /etc/nginx/fastcgi_params;
               }
               location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
                       root /usr/share/;
               }
        }
        location /phpMyAdmin {
               rewrite ^/* /phpmyadmin last;
        }
}
为我工作…

问题是“default”行有“https”,而“stores”行有“http”

使用PhpMyAdmin执行以下SQL命令:

SELECT * FROM `core_config_data` WHERE path like '%secure/base_url'
然后检查所有安全行是否以“https”开头。

问题是“default”行有“https”,而“stores”行有“http”

使用PhpMyAdmin执行以下SQL命令:

SELECT * FROM `core_config_data` WHERE path like '%secure/base_url'

然后检查所有安全行是否以“https”开头。

Nginx没有.htaccess:| Nginx没有.htaccess:|您可以在Nginx配置中提供更多详细信息吗?我添加了Nginx配置文件。您可以在Nginx配置中提供更多详细信息吗?我添加了Nginx配置文件。您可能也有权限问题。。。将所有内容设置为777,然后重试,并再次将权限设置回正常状态…您可能也有权限问题。。。将所有内容设置为777,然后重试,并再次将权限设置为正常。。。