简体   繁体   English

从本地主机迁移后 Prestashop 1.7.6.4 500 服务器错误

[英]Prestashop 1.7.6.4 500 server error after migration from localhost

After migration from localhost to hosting provider I receive error 500 in Prestashop.从 localhost 迁移到托管服务提供商后,我在 Prestashop 中收到错误 500。 First of all I thought that the problem is version of PHP.首先,我认为问题出在 PHP 的版本上。 But after change PHP version on hosting error is still displayed.但更改 PHP 版本后仍然显示托管错误。 Before migration I changed 'ps_configuration' table in database also 'ps_shop_url' and SEO&URL settings in Prestashop panel.在迁移之前,我更改了数据库中的“ps_configuration”表以及 Prestashop 面板中的“ps_shop_url”和 SEO&URL 设置。 Nothing works.没有任何效果。 Where can I look for a solution to my problem?我在哪里可以找到解决问题的方法? I also attach the htaccess file for review.我还附上了 htaccess 文件以供审查。

First screen from database Second screen from database数据库中的第一个屏幕 数据库中的第二个屏幕

.htaccess file below .htaccess文件如下

<IfModule mod_rewrite.c>
<IfModule mod_env.c>
SetEnv HTTP_MOD_REWRITE On
</IfModule>

RewriteEngine on


#Domain: spawber.com.pl
RewriteRule . - [E=REWRITEBASE:/spawber/]
RewriteRule ^api(?:/(.*))?$ %{ENV:REWRITEBASE}webservice/dispatcher.php?url=$1 [QSA,L]

# Images
RewriteCond %{HTTP_HOST} ^spawber.com.pl$
RewriteRule ^([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$1$2$3.jpg [L]
RewriteCond %{HTTP_HOST} ^spawber.com.pl$
RewriteRule ^([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$1$2$3$4.jpg [L]
RewriteCond %{HTTP_HOST} ^spawber.com.pl$
RewriteRule ^([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$1$2$3$4$5.jpg [L]
RewriteCond %{HTTP_HOST} ^spawber.com.pl$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$1$2$3$4$5$6.jpg [L]
RewriteCond %{HTTP_HOST} ^spawber.com.pl$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6$7.jpg [L]
RewriteCond %{HTTP_HOST} ^spawber.com.pl$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7$8.jpg [L]
RewriteCond %{HTTP_HOST} ^spawber.com.pl$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8$9.jpg [L]
RewriteCond %{HTTP_HOST} ^spawber.com.pl$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9$10.jpg [L]
RewriteCond %{HTTP_HOST} ^spawber.com.pl$
RewriteRule ^c/([0-9]+)(\-[\.*_a-zA-Z0-9-]*)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/c/$1$2$3.jpg [L]
RewriteCond %{HTTP_HOST} ^spawber.com.pl$
RewriteRule ^c/([a-zA-Z_-]+)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/c/$1$2.jpg [L]
# AlphaImageLoader for IE and fancybox
RewriteRule ^images_ie/?([^/]+)\.(jpe?g|png|gif)$ js/jquery/plugins/fancybox/images/$1.$2 [L]

# Dispatcher
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ %{ENV:REWRITEBASE}index.php [NC,L]
</IfModule>

AddType application/vnd.ms-fontobject .eot
AddType font/ttf .ttf
AddType font/otf .otf
AddType application/font-woff .woff
AddType font/woff2 .woff2
<IfModule mod_headers.c>
    <FilesMatch "\.(ttf|ttc|otf|eot|woff|woff2|svg)$">
        Header set Access-Control-Allow-Origin "*"
    </FilesMatch>
</IfModule>

#If rewrite mod isn't enabled
ErrorDocument 404 /spawber/index.php?controller=404

# ~~end~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again

PHP +7 uses the 500 error page to hide the errors. PHP +7 使用 500 错误页面来隐藏错误。

It may seem obvious, but have you tried to enable the debug mode?这似乎很明显,但是您是否尝试过启用调试模式?

Edit config/defines.inc.php file and update this value:编辑 config/defines.inc.php 文件并更新此值:

if (!defined('_PS_MODE_DEV_')) {
define('_PS_MODE_DEV_', false);
}

Or if you just want to enable the debug for your IP you can add this before the mentioned line:或者,如果您只想为您的 IP 启用调试,您可以在上述行之前添加:

if (!defined('_PS_MODE_DEV_')) {
    $debug_ips = array('XXX.XXX.XXX.XXX');
    if (in_array($_SERVER['REMOTE_ADDR'], $debug_ips) 
        || in_array($_SERVER['HTTP_X_FORWARDED_FOR'], $debug_ips) 
        || in_array($_SERVER['HTTP_X_REAL_IP'], $debug_ips)) {
        define('_PS_MODE_DEV_', false);
    }
}

And replace XXX.XXX.XXX.XXX for your IP并为您的 IP 替换 XXX.XXX.XXX.XXX

Once the debug more is enabled unless the error comes from the .htaccess you should see the message.一旦启用了更多调试,除非错误来自 .htaccess,否则您应该会看到该消息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM