You are not logged in.

#1 2016-06-15 13:26:29

Zulgrib
Member
Registered: 2016-06-15
Posts: 1

Migrated prestashop website returns error 500

Using nginx, php-fpm and mariadb from official repo

Loading website returns error 500 with no new line inside /var/log/mywebsite/nginx_error.log , php log /var/log/mywebsite/fpm-php.log is empty too.
Access log in /var/log/nginx/access.log do show someone tried to load stuff and produce lines like this

IP.IP.IP.IP - - [15/Jun/2016:14:48:57 +0200] "GET / HTTP/1.1" 500 5 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.84 Safari/537.36"

Loading dumb phpinfo file from the same domain works and produce this line in access log.

IP.IP.IP.IP - - [15/Jun/2016:13:06:42 +0200] "GET /phpinfo.php HTTP/1.1" 200 24834 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.84 Safari/537.36"

Using dumb html file as index works as expected.

php's logs inside journalctl shows nothing but the usual successful startup/shutdown

Files are stored inside a folder, in website's user home, this folder is symlinked to /srv/http. nginx do root to the /srv path, php has open_base_dir to the same place but no chroot made inside nginx's or php-fpm's service file yet.

Before migration, the website was running with apache, php 5 and mysql on a popular web hosting service, but I expected error logs to resolve potential problems.

Last edited by Zulgrib (2016-06-15 13:33:50)

Offline

#2 2016-06-16 15:46:22

Magissia
Member
Registered: 2013-05-06
Posts: 7

Re: Migrated prestashop website returns error 500

Prestashop is not compatible with PHP7 until version 1.6.1.4, you may want to check that.

Offline

#3 2016-06-20 09:48:43

Elizine
Member
From: United Kingdom
Registered: 2015-10-07
Posts: 39
Website

Re: Migrated prestashop website returns error 500

1) File / Folder Permissions - Most modern hosts (that offer cPanel) will block PHP files that are set to 777 or that are in a folder that is set to 777, or even if one of the parent folders is 777.
Instead of running the file, your host will show the error 500. The reason for it is server security- when a file is set to 777, anyone can change it and plant malicious code in there.
You may ask yourself "Why do the Prestashop installation instructions say to use 777"? Well, it seems that 777 in French translates to 755 in English smile
We did ask them to modify the instructions but for whatever reason, our request was overlooked. Some very old server configuration or ones that are not properly configured won't work properly with 755 and require 777, but it seems that they are very few (since it's a major security risk).
No files or folders should be set to 777, 755 should be the maximum permissions setting.

2) Server timeout - Every server has a timeout setting, which is the time that a script is allowed to run.
These limits vary from host to host; some set it as low as 30 seconds and don't allow you to change it, and others set it to 5-10 minutes and let you change it.
If you run a script that requires a long time to finish (thumbnail regeneration, import/export, or backup) and it reaches the timeout setting, an error 500 page will be displayed.
You should contact your host and inquire about increasing the timeout limit.

3) Incorrect syntax in .htaccess file - The syntax in the .htaccess file is very strict, if you add an incorrect command, or even an incorrect character, your server will return error 500.
Try removing the .htaccess file, to make sure it is that cause, and then recreate it from Prestashop (Keep a backup of the original .htaccess in case your host had some required variables in there).

Offline

Board footer

Powered by FluxBB