Prestashop ошибка 500

Learn about the HTTP 500 error code you encounter that causes so many problems, and how to resolve it for an online store.

Have you ever wondered why the screen suddenly turns white while browsing your website, displaying a «HTTP 500 error»?

This is a problem that can occur from time to time, especially when you start updating your theme or modules from your PrestaShop online store..

But there is a simple solution, as you will see in today’s article.

Once you have created your online store and set up everything you need to start selling your products or services, a HTTP 500 error (or internal server error) may appear. No need to panic!

However, we recommend that you take the time to resolve it, because if an error of this type persists over time, it can lead to serious losses for your company’s website, since it prevents users from browsing your site and therefore, purchasing your products.

But first of all, what is this error?

A server displays a HTTP 500 error (or internal server error) when it cannot process a request, a request that should be correct in principle.

Since each server can use its own texts and terminology, the error message can take many forms.

Here are some of the most common error messages:

  • «Error 500 (Internal Server Error)»
  • «Error 500 — Internal server error»
  • «Internal server error»
  • «HTTP ERROR 500»
  • «Error 500»
  • «HTTP Error 500»

What is a 500 error?

Of course, such an anomaly can be rather worrying if you own an online store and this store is your main source of income.

And for web developers, it’s a nightmare: a frantic race to get your site up and running again.

But how serious is a 500 error?

Although it sounds terrifying, encountering such a problem on your online store is not the end of the world.

In this article, we will explain how to fix it in your PrestaShop shop.

So next time, you will have nothing to worry about, and can act quickly to avoid delaying your sales any further!

How can I detect a HTTP 500 error in my PrestaShop shop?

In summary, this famous 500 error is the web server’s way of saying «Oops! An error has occurred, but we can’t tell you more.»

This is known as a server-side problem.

In other words, a failure has occurred within the hosting service which hosts the website.

This is a very general warning, usually due to problems with PHP settings, programming or website permissions.

In most cases, this glitch is accompanied by a rather brief explanation, similar to this one:

The server reported an unexpected error and cannot complete the client’ s request.

It is very important not to confuse it with the HTTP 404 error (page not found), that is also covered in this blog, and available to consult at any time.

Remember that this error can occur in any browser and operating system (so no, buying the new Apple Mac Pro will not prevent you from being confronted with it at some point…)

» Here is a screenshot with an example of how this error may be displayed:

500 internal server error Google

How can I fix a HTTP 500 error on my online store website?

Although the error message is not very detailed, PrestaShop will give you more in-depth information about this problem.

Some servers, due to their configuration, often hide more specific error messages.

Therefore, if you have the same problem on your site and the error messages are too vague, you can activate your web host’s FTP or CPanel error reports in your PrestaShop shop.

There are 2 ways to enable these reports, depending on the version you are using:

» From PrestaShop v1.4 to v1.5.2

  1. Open config/config.inc.php
  2. On line 29, you will find this line: @ini_set(‘display_errors’,’off’);
  3. Replace it with: @ini_set(‘display_errors’,’on’);

» PrestaShop v1.5.3 and later versions (including 1.6 and 1.7)

  1. Open config/defines.inc.php
  2. On line 28, you will find this line: define(‘_PS_MODE_DEV_’, false);
  3. Replace it with: define(‘_PS_MODE_DEV_’, true);

Once error reports from the FTP or CPanel are activated, you can browse your store’s front or back office to find out what the problem is.

Also, if you cannot access your website due to error 500, you can enable the error report and refresh the page that failed to display.

You will then be provided more information that will help you to understand the causes and location of this incident.

What can cause an error 500?

What can cause an error 500?

Now that you have more information, you can use some of the standard tips below to deepen your understanding.

To begin, review the most common causes of the problem. If we know the cause of the problem, it is much easier to find the right solution and act accordingly.

The problem may be related to the following causes:

1. Permission error

In many cases, you will find that folder permissions are not set correctly.

To correct this error, simply set a file or folder authorisation to 755 instead of 777 (or vice versa).

In general, 777 permissions are incredibly unprotected and even an amateur hacker can enter your files and add harmful malware.

Check the specific permissions features with your host, as some servers use different rules.

2. Incorrect configuration of the.htaccess file

Internal server problems are often caused by a poorly configured .htaccess file.

As far as PrestaShop is concerned, the problems are generally related to URL re-writing options and activating «friendly URLs».

A .htaccess file’s format is very strict, and even an incorrect character or command could cause an internal 500 server error. Therefore, from the «friendly URLs» option, indicating «NO» could be a solution (don’t forget to save your changes).

We recommend that you backup your.htaccess file and restore it from the back office, or disable friendly URLs.

3. Waiting time has expired

Each server has its own waiting time, which determines how long a script will run.

If the function or script exceeds this time limit, you will receive a 500 error.

Here are the PrestaShop scripts that may take too long to load:

  • Importing CSV files.
  • Backup files.
  • Loading translations.
  • Import/export.
  • Regenerating miniature views.

In most cases, the server time limit is 30 seconds, which is not enough for these scripts.

In this case, you should contact your host and ask them to change this setting (at least temporarily).

4. Obsolete modules

When updating your shop (for example: if you upgrade from version 1.6 to version 1.7), you may encounter obsolete modules or modules that are incompatible with this new version of PrestaShop.

This can generate 500 errors. In this case, we will need to review all the Addons you have previously installed, or at least those that are available in a more recent version.

We recommend that you always have the official PrestaShop Marketplace page ready (or saved in your favourites), where you can obtain official modules, which are always up-to-date.

Marketplace Addons PrestaShop

What if this HTTP 500 error persists in my shop once I have completed these checks?

In this case, you should consult the Apache and PHP error logs.

While some of these may be provided by your host, you may need to contact them directly to access the files.

«There are other solutions available on our forum»

Even if it seems obvious at first glance, when you receive specific PrestaShop information concerning the error or log file, you may want to do a Google search (focus on the problem and add the word «PrestaShop» to your search).

You will then find various information and tutorials for the type of error that occurred.

You will also certainly find discussions on the PrestaShop forum, entitled «[RESOLVED]».

Go through it carefully and, if after reading this post, you still haven’t been able to correct your error, be sure to register on the PrestaShop forums and ask for help.

With over a million members, you are sure to find answers to your questions, with the help of other users.

There are also official PrestaShop support plans.

These will allow you to contact us, and to obtain additional assistance from one of our representatives.

Conclusion

At the beginning of this article, we told you that a HTTP 500 error or internal server error is not as bad as it seems.

Now you have the right tools to correct one of the most dreaded errors amongst Internet users.

Start your online store with the PrestaShop online software, and continue selling your products or services with total peace of mind!

“500 Internal Server Error” or plain “Internal Server Error” is common in Prestashop installations.

As a Server Administration Service provider, we’ve seen a wide range of reasons for this error in Nginx servers, Apache, IIS, LiteSpeed and more.

It can range from Memory limits and File permission issues to obscrure Deadlock errors and Cache issues.

Prestashop error 500

Here’s what an HTTP error 500 looked like in a Prestashop hosted in Nginx.

What is HTTP 500 Internal Sever Error?

500” is an universal error code used by all Web Servers to say, “Some error happened. I have no clue what!

Yeah, not very helpful.

But, the HTTP error logs can (and often will) show you what has gone wrong.

How to troubleshoot Error 500

Every web server will have an error log.

For Apache servers, it is usually located at /var/log/apache/error.log. It will show you something like:

[Wed Apr 18 12:59:12.862338 2018] [php7:error] [pid 3538] [client XX.XX.XX.XX:31504] PHP Fatal error: Out of memory (allocated 2097152) (tried to allocate 59462712 bytes) in /home/myuser/public_html/classes/Configuration.php on line 206

Again, not very helpful unless you know what these numbers mean.

Now, let’s look at another option.

Troubleshooting Error 500 in Prestashop

In Prestashop, you can also get some additional information by turning on error reporting in the file “config/defines.inc.php

  • For Prestashop v1.5.2 and lower, change @ini_set('display_errors', 'off'); to @ini_set('display_errors', 'on');.
  • For Prestashop v1.5.3 and higher, change define('_PS_MODE_DEV_', false); to define('_PS_MODE_DEV_', true);.

Then take the page that gave you the error once more, and you’ll see something like this:

[PrestaShopDatabaseException]
Db->executeS() must be used only with select, show, explain or describe queries at line 471 in file classes/db/Db.php
465.
466. // This method must be used only with queries which display results
467. if (!preg_match('#^s*(?s*(select|show|explain|describe|desc)s#i', $sql))

OK, that can look scary too.

Just tell me how to fix this

Now, if you are like most website owners, you’ll want to know what are the common reasons for this error, so that you can try out some solutions yourself.

Don’t worry, we have you covered.

Here we have the top 7 reasons why you’ll get this error, and what you can do to fix them.

1. Low PHP Memory Limit

The most common reason we’ve seen for error 500 is low memory limit for PHP.

Many web hosts set the default memory allocation for PHP as 32 MB, 64 MB or 128 MB.

However, Prestashop requires at least 128 MB to function, and throw in some more for add-ons if you need them.

So, a sensible memory allocation is “256 MB”. If you have a VPS, set it to “512 MB”.

How to increase PHP Memory Limit

There are many ways to increase PHP memory size.

Some hosts provide web administration interface. Some allow command line access.

Here’s one way that we’ve seen to be working for many:

  • Login to your FTP account.
  • Download .htaccess file.
  • Add the line php_value memory_limit 512M in the file, and save
  • Re-upload the file.

If you are not sure how to do this, or if editing is disallowed in your account, our Prestashop experts can help you fix this. Click here to submit a support request. We are online 24/7.

2. Wrong file & folder permissions

Some servers that have SuPHP or Fast-CGI enabled can be especially sensitive to file and folder permissions.

The right permissions for files is 644 and folders is 755.

If you see from the server logs or Prestashop error report that file permissions maybe the issue, try resetting the permissions using the commands:

find /home/USERNAME/public_html -type d -exec chmod 755 {} ;
find /home/USERNAME/public_html -type f -exec chmod 644 {} ;

Replace /home/USERNAME/public_html with the path to your web directory.

You might also do this from an admin front-end (if you are provided with one).

Warning : Take a backup of your site before you execute any command.

If you are not sure how to reset the file and folder permissions, click here to request support. Our Prestashop experts are online 24/7.

3. Corrupted files or wrong encoding

Many Prestashop owners come to us saying the site broke after they tried to change something.

We’ve seen that often these issues are caused by incorrect file encoding or stray spaces that’s inserted while editing the files.

If you are not a web hosting expert, the best way to solve this is to download a fresh copy of Prestashop, and replace recently changed files.

If you’ve made extensive changes to your files, you’ll need to manually check the file formats and comb for syntax errors.

If you find that difficult, don’t worry. We can do it for you in a few minutes. Click here to open a support request to our Prestashop experts. We’re online 24/7.

4. Coding error in recently installed/updated module or theme

Prestashop addons (themes and modules) help you setup a shop just like you imagined.

But the downside is that some of these themes and modules might not be well maintained.

Many times we’ve seen some module using deprecated functions, or incorrect code, causing Prestashop to display the white screen.

So, if error 500 was shown after you recently installed or upgraded a new addon, try deleting that addon folder from backend. It should be located in the /themes/ or /modules/ folder in your Prestashop’s public_html.

If you are unable to find out which addon caused the error, we can fix that for you. Click here to open a support request to our 24/7 Prestashop support team.

5. Missing PHP modules

A common issue we’ve seen with Prestashop sites in VPSs is that they lack all the needed PHP modules.

For Prestashop to function, it needs:

  • Mcrypt
  • OpenSSL
  • Zip
  • Curl
  • GD
  • PDO

To check if these modules are enabled for your website, copy the below code into a file called phpinfo.php and upload it to your site. Then take it in a browser, and check for these extensions.

phpinfo();
?>
If any of those modules are missing, check your server’s php.ini to see if it is enabled. If not, you’ll need to install them.

Installing modules can get a bit technical. If you suspect PHP modules are missing in your server, click here to request support from our Prestashop experts. We can fix that for you in a few minutes.

Note: Remember to delete the phpinfo.php file once you are done. Hackers could use that to target specific vulnerabilities.

6. Database connection limit

Some users have reported the error : “PrestaShop Fatal error: no utf-8 support. Please check your server configuration“.

This might look like UTF-8 support isn’t enabled in the server.

But in reality, it is just Prestashop unable to run a database query.

Some servers have database query limits (eg. 10,000 queries per hour). Any query above that limit wouldn’t be sent to the MySQL database, and it’ll show the UTF-8 error.

Of course it is also possible that the UTF-8 encoding in your database might be changed due to some reason.

If you have a VPS, you can fix this by changing the max_questions variable in the MySQL configuration file to 0 (means unlimited).

If you need help fixing the database limits, our Prestashop experts are online 24/7. Click here to open a support request.

7. Stale cache, incorrect .htaccess and many others

OK, this is not exactly ONE reason. This point exists to say there could be a lot more other reasons why Error 500 can happen.

Some of them are:

  • .htaccess errors : Syntax errors in .htaccess files, especially those used to pass PHP variables can cause compilation errors.
  • Security settings : Some security settings such as mod_security limits can cause the execution to fail. It’ll need to be found out by looking at the web server logs.
  • Many more : Basically anything that blocks the proper execution of Prestashop files can cause this error. If none of these seem to fit your issue, you’ll need to enable Error Reporting.

None of these fixes worked. What now?

There’s good news and bad news.

Bad news is that you’ll really have to geek out the cryptic log files.

Good news is that, you really don’t have to.

Here at Bobcares, our Prestashop experts do this kind of troubleshooting all day long.

It’ll take us only a few minutes to go through the logs and zero in on the solution.

So, if you need help, click here to get a Prestashop expert to look into your site. Yes, we are online 24/7.

Conclusion

Prestashop error 500 can happen due to PHP memory limits, file permission issues, database connection errors, and more. Here we have listed the top 7 reasons for this error, and how you can resolve it yourself.

13 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Comment *

Name *

Email *

“500 Internal Server Error” or plain “Internal Server Error” is popular when installing and using any web platform. Not only PrestaShop but you might also encounter this error on WordPress, Shopify, Magento websites and so on. This disreputable HTTP Error 500 could turn an online store owner’s smile to a bewildered frown with one click. The fear of lost sales, it stonewalls your customers’ ability to browse your store and purchase products. For web developers, this error is a nightmare. Everyone has to scurry to get his or her stores back online.

As terrible as it sounds, it’s not too scary. On this post, I’ll explain the error and offer some troubleshooting ideas for your PrestaShop store. The next time you encounter this error, instead of hiding under your blanket, you’ll be prepared to act fast, handle the issue and keep on making deals. Even if you’re not using PrestaShop, these solutions can still worth to take a try.

How to perceive the HTTP Error 500

It’s necessary to not confound the HTTP Error 500 with the Error 404 Page Not Found. To deal with the error, firstly, we have to go over the various ways you may see this error message on your PC. There are different appearances of this message due to each host/server is permitted to adjust the way it’s shown. Here are some regular ways you may see this error.

  • «500 Internal Server Error»
  • «Internal Server Error»
  • «500 Error»
  • «HTTP 500 — Internal Server Error»
  • «HTTP 500 Internal Error»
  • «HTTP Error 500»

Most occasions you will see this message accompanied by different types of this classic familiar line «The server encountered an internal error or misconfiguration and was unable to complete your request». And this error can appear on any web browser and any operating system. Here is a screen capture of one of the forms Error 500 may be displayed on your browser. 

So, what is the HTTP Error 500?

Simply put, the Error 500 is the way your web server saying «Something turned out badly but I have no clue what it is!» Well, it’s really unhelpful at all. But, the HTTP error logs can (and usually will) show you what has gone wrong.

How can I troubleshoot HTTP Error 500?

Each web server will have an error log. For Apache servers, it is usually located at /var/log/apache/error.log. It will show you something like this:

[Thu Nov 22 12:59:12.862338 2018] [php7:error] [pid 3538] [client XX.XX.XX.XX:31504] PHP Fatal error: Out of memory (allocated 2097152) (tried to allocate 59462712 bytes) in /home/myuser/public_html/classes/Configuration.php on line 206

Again, not very helpful unless you recognize what these numbers mean. But don’t be worry, we still have another option.

Troubleshooting Error 500 for PrestaShop website

If your PrestaShop store is suffering from this error, you can get some detailed information by turning on PrestaShop’s Error Reporting in the file “config/defines.inc.php”. There are 2 ways to turn on Error Reporting depending on what PrestaShop version you have. For PrestaShop v1.4 through v1.5.2

  • Open config/config.inc.php
  • On or around line 29 you will find this line @ini_set(‘display_errors’, ‘off’);
  • Change that line to read @ini_set(‘display_errors’, ‘on’);

For PrestaShop v1.5.3 and higher versions

  • Open config/defines.inc.php
  • On or around line 28 you will find this line define(‘_PS_MODE_DEV_’, false);
  • Change that line to read define(‘_PS_MODE_DEV_’, true);

Then back to the page that gave you the error once more, and you’ll see something like this:

[PrestaShopDatabaseException] Db->executeS() must be used only with select, show, explain or describe queries at line 471 in file classes/db/Db.php 465. 466. // This method must be used only with queries which display results 467. if (!preg_match(‘#^s*(?s*(select|show|explain|describe|desc)s#i’, $sql))

OK, more info but still scary for us.

Just show me how to fix this error

For most PrestaShop store owners, you’ll want to know the most common ways this problem is caused so that you can try out some solutions yourself. Here we have the best 5 reasons why Error 500 occurs, and what you can do to address them.

1. File and folder permission is wrong

Some servers that have SuPHP or Fast-CGI turned on can be especially sensitive to file and folder permissions. The right permission for files is 644 and folders is 755. If you see from the server logs or PrestaShop error report that file permissions may be the problem, try resetting the permissions with these commands:

find /home/USERNAME/public_html -type d -exec chmod 755 {} ; find /home/USERNAME/public_html -type f -exec chmod 644 {} ;

Replace /home/USERNAME/public_html with the path to your web directory.

Note: Take a backup of your site before you execute any command

2. Incorrectly configured .htaccess file

Most of the times, you will receive an internal server error when the htaccess file is configured incorrectly. The main culprits of the htaccess errors are «URL Rewrite» settings or Friendly URL enabling. The htaccess syntax is very strict, if you add an incorrect command, or even an incorrect character, your server will return error 500. Make a backup of your htaccess and regenerate the htaccess file either through the back office or by toggling the Enable Friendly URL option.

3. Server timeout

Every server has their own timeout setting, which sets the time that any given script can run. If the function or script crosses that limit, Error 500 will occur. The most common scripts in PrestaShop that may take too long to load are CSV Imports, backups, translation loading, import/exports and thumbnail regeneration. Many server limits are set to 30 seconds, which is not long enough to run these scripts. You should contact your hosting provider and inquire about changing the limit, at least temporarily.

4. Low PHP memory limit

Many web hosts set the default memory allocation for PHP as 32 MB, 64 MB or 128 MB. However, PrestaShop requires at least 128 MB to function and put in some more for modules if you need them. So, a suitable memory allocation is 256 MB. If you have a VPS, set it to 512 MB.

5. Missing PHP modules

A common issue seen with PrestaShop sites in VPSs is that they lack all the needed PHP modules. To help PrestaShop function, we will need:

  • Mcrypt
  • OpenSSL
  • Zip
  • Curl
  • GD
  • PDO

To check if these modules are enabled for your website, copy the code below into «phpinfo.php» file and upload it to your site. Then open it in a browser, and check for these extensions.

<? phpinfo(); ?>

If any of those modules are missing, open your server’s php.ini file to see if it is enabled. If not, you’ll need to install them manually.

Note: Remember to delete the phpinfo.php file once you are done. Hackers could use that to target specific vulnerabilities.

Содержание

  1. Prestashop Error 500 – Top 7 reasons, and how to fix them
  2. What is HTTP 500 Internal Sever Error?
  3. How to troubleshoot Error 500
  4. Troubleshooting Error 500 in Prestashop
  5. Just tell me how to fix this
  6. 1. Low PHP Memory Limit
  7. How to increase PHP Memory Limit
  8. 2. Wrong file & folder permissions
  9. 3. Corrupted files or wrong encoding
  10. 4. Coding error in recently installed/updated module or theme
  11. 5. Missing PHP modules
  12. 6. Database connection limit
  13. 7. Stale cache, incorrect .htaccess and many others
  14. None of these fixes worked. What now?
  15. Conclusion
  16. 13 Comments
  17. What is the HTTP 500 error and how can I fix it in my PrestaShop online store?
  18. What is a HTTP 500 error?
  19. But how serious is a 500 error?
  20. How can I detect a HTTP 500 error in my PrestaShop shop?
  21. » Here is a screenshot with an example of how this error may be displayed:
  22. How can I fix a HTTP 500 error on my online store website?
  23. There are 2 ways to enable these reports, depending on the version you are using:
  24. » From PrestaShop v1.4 to v1.5.2
  25. » PrestaShop v1.5.3 and later versions (including 1.6 and 1.7)
  26. What can cause an error 500?
  27. 1. Permission error
  28. 2. Incorrect configuration of the.htaccess file
  29. 3. Waiting time has expired
  30. 4. Obsolete modules
  31. What if this HTTP 500 error persists in my shop once I have completed these checks?
  32. «There are other solutions available on our forum»
  33. Conclusion

Prestashop Error 500 – Top 7 reasons, and how to fix them

by Visakh S | May 28, 2018

“500 Internal Server Error” or plain “Internal Server Error” is common in Prestashop installations.

As a Server Administration Service provider, we’ve seen a wide range of reasons for this error in Nginx servers, Apache, IIS, LiteSpeed and more.

It can range from Memory limits and File permission issues to obscrure Deadlock errors and Cache issues.

Here’s what an HTTP error 500 looked like in a Prestashop hosted in Nginx.

What is HTTP 500 Internal Sever Error?

500” is an universal error code used by all Web Servers to say, “Some error happened. I have no clue what!

Yeah, not very helpful.

But, the HTTP error logs can (and often will) show you what has gone wrong.

How to troubleshoot Error 500

Every web server will have an error log.

For Apache servers, it is usually located at /var/log/apache/error.log . It will show you something like:

[Wed Apr 18 12:59:12.862338 2018] [php7:error] [pid 3538] [client XX.XX.XX.XX:31504] PHP Fatal error: Out of memory (allocated 2097152) (tried to allocate 59462712 bytes) in /home/myuser/public_html/classes/Configuration.php on line 206

Again, not very helpful unless you know what these numbers mean.

Now, let’s look at another option.

Troubleshooting Error 500 in Prestashop

In Prestashop, you can also get some additional information by turning on error reporting in the file “config/defines.inc.php

  • For Prestashop v1.5.2 and lower, change @ini_set(‘display_errors’, ‘off‘); to @ini_set(‘display_errors’, ‘on‘); .
  • For Prestashop v1.5.3 and higher, change define(‘_PS_MODE_DEV_’, false); to define(‘_PS_MODE_DEV_’, true); .

Then take the page that gave you the error once more, and you’ll see something like this:

[PrestaShopDatabaseException]
Db->executeS() must be used only with select, show, explain or describe queries at line 471 in file classes/db/Db.php
465.
466. // This method must be used only with queries which display results
467. if (!preg_match(‘#^s*(?s*(select|show|explain|describe|desc)s#i’, $sql))

OK, that can look scary too.

Just tell me how to fix this

Now, if you are like most website owners, you’ll want to know what are the common reasons for this error, so that you can try out some solutions yourself.

Don’t worry, we have you covered.

Here we have the top 7 reasons why you’ll get this error, and what you can do to fix them.

1. Low PHP Memory Limit

The most common reason we’ve seen for error 500 is low memory limit for PHP.

Many web hosts set the default memory allocation for PHP as 32 MB, 64 MB or 128 MB.

However, Prestashop requires at least 128 MB to function, and throw in some more for add-ons if you need them.

So, a sensible memory allocation is “256 MB”. If you have a VPS, set it to “512 MB”.

How to increase PHP Memory Limit

There are many ways to increase PHP memory size.

Some hosts provide web administration interface. Some allow command line access.

Here’s one way that we’ve seen to be working for many:

  • Login to your FTP account.
  • Download .htaccess file.
  • Add the line php_value memory_limit 512M in the file, and save
  • Re-upload the file.

If you are not sure how to do this, or if editing is disallowed in your account, our Prestashop experts can help you fix this. Click here to submit a support request. We are online 24/7.

2. Wrong file & folder permissions

Some servers that have SuPHP or Fast-CGI enabled can be especially sensitive to file and folder permissions.

The right permissions for files is 644 and folders is 755 .

If you see from the server logs or Prestashop error report that file permissions maybe the issue, try resetting the permissions using the commands:

find /home/USERNAME/public_html -type d -exec chmod 755 <> ;
find /home/USERNAME/public_html -type f -exec chmod 644 <> ;

Replace /home/USERNAME/public_html with the path to your web directory.

You might also do this from an admin front-end (if you are provided with one).

Warning : Take a backup of your site before you execute any command.

If you are not sure how to reset the file and folder permissions, click here to request support. Our Prestashop experts are online 24/7.

3. Corrupted files or wrong encoding

Many Prestashop owners come to us saying the site broke after they tried to change something.

We’ve seen that often these issues are caused by incorrect file encoding or stray spaces that’s inserted while editing the files.

If you are not a web hosting expert, the best way to solve this is to download a fresh copy of Prestashop, and replace recently changed files.

If you’ve made extensive changes to your files, you’ll need to manually check the file formats and comb for syntax errors.

If you find that difficult, don’t worry. We can do it for you in a few minutes. Click here to open a support request to our Prestashop experts. We’re online 24/7.

4. Coding error in recently installed/updated module or theme

Prestashop addons (themes and modules) help you setup a shop just like you imagined.

But the downside is that some of these themes and modules might not be well maintained.

Many times we’ve seen some module using deprecated functions, or incorrect code, causing Prestashop to display the white screen.

So, if error 500 was shown after you recently installed or upgraded a new addon, try deleting that addon folder from backend. It should be located in the /themes/ or /modules/ folder in your Prestashop’s public_html .

If you are unable to find out which addon caused the error, we can fix that for you. Click here to open a support request to our 24/7 Prestashop support team.

5. Missing PHP modules

A common issue we’ve seen with Prestashop sites in VPSs is that they lack all the needed PHP modules.

For Prestashop to function, it needs:

To check if these modules are enabled for your website, copy the below code into a file called phpinfo.php and upload it to your site. Then take it in a browser, and check for these extensions.

phpinfo();
?>
If any of those modules are missing, check your server’s php.ini to see if it is enabled. If not, you’ll need to install them.

Installing modules can get a bit technical. If you suspect PHP modules are missing in your server, click here to request support from our Prestashop experts. We can fix that for you in a few minutes.

Note: Remember to delete the phpinfo.php file once you are done. Hackers could use that to target specific vulnerabilities.

6. Database connection limit

Some users have reported the error : “PrestaShop Fatal error: no utf-8 support. Please check your server configuration“.

This might look like UTF-8 support isn’t enabled in the server.

But in reality, it is just Prestashop unable to run a database query.

Some servers have database query limits (eg. 10,000 queries per hour). Any query above that limit wouldn’t be sent to the MySQL database, and it’ll show the UTF-8 error.

Of course it is also possible that the UTF-8 encoding in your database might be changed due to some reason.

If you have a VPS, you can fix this by changing the max_questions variable in the MySQL configuration file to 0 (means unlimited).

If you need help fixing the database limits, our Prestashop experts are online 24/7. Click here to open a support request.

7. Stale cache, incorrect .htaccess and many others

OK, this is not exactly ONE reason. This point exists to say there could be a lot more other reasons why Error 500 can happen.

Some of them are:

  • .htaccess errors : Syntax errors in .htaccess files, especially those used to pass PHP variables can cause compilation errors.
  • Security settings : Some security settings such as mod_security limits can cause the execution to fail. It’ll need to be found out by looking at the web server logs.
  • Many more : Basically anything that blocks the proper execution of Prestashop files can cause this error. If none of these seem to fit your issue, you’ll need to enable Error Reporting.

None of these fixes worked. What now?

There’s good news and bad news.

Bad news is that you’ll really have to geek out the cryptic log files.

Good news is that, you really don’t have to.

Here at Bobcares, our Prestashop experts do this kind of troubleshooting all day long.

It’ll take us only a few minutes to go through the logs and zero in on the solution.

Conclusion

Prestashop error 500 can happen due to PHP memory limits, file permission issues, database connection errors, and more. Here we have listed the top 7 reasons for this error, and how you can resolve it yourself.

Or it may be an openbase_dir problem like we had on carcasadura.ro

Thanks for your help, it worked for me.

Agree with the 7 causes you mentioned.. as a developer, wrong query syntax also cause 500 error..

Mon problème était que j’ai installé manuellement Prestashop V7 alors que mon site avait la version V6, et après plusieurs recherches j’ai trouvé qu’on ne pouvait pas passer de Prestashop V6 à la version V7, alors qu’avant on pouvait passer de la V5 à la V6, désormais ce n’est plus possible. C’est pour cette raison que j’ai rencontré l’erreur 500, en vérifiant le fichier log j’ai eu le message suivant :

Link to database cannot be established: SQLSTATE[HY000] [1045] Access denied for user ‘nels_prestash’@’localhost’ (using password: YES) at line 127 in file classes/db/DbPDO.php

J’espère que ça aidera d’autres personnes.

Bonjour Lucinda,
Oui, la mise à niveau de Prestasop peut entraîner des erreurs pouvant nécessiter une correction manuelle.

I am working on prestashop 1.7. When I click ‘Add Category’ from Category it shows: 500 – Internal Server Error

I am pasting here the error as it is:

500 – Internal Server Error
This is a temporary server error.
Please try to reload the webpage later.
If you are the webmaster of this site please log in to Cpanel and check the Error Logs. You will find the exact reason for this error there.

Common reasons for this error are:

Incorrect file/directory permissions: Above 755.
In order files to be processed by the webserver, their permissions have to be equal or below 755. You can update file permissions with a FTP client or through cPanel’s File Manager.

Incorrect Apache directives inside .htaccess file.
Make sure you have not specified unsupported directives inside the local .htaccess file. Such include PHP settings and Apache module settings.

Hello Rizwan,
Thank you for the inputs.

Источник

What is the HTTP 500 error and how can I fix it in my PrestaShop online store?

Have you ever wondered why the screen suddenly turns white while browsing your website, displaying a «HTTP 500 error»?

This is a problem that can occur from time to time, especially when you start updating your theme or modules from your PrestaShop online store..

But there is a simple solution, as you will see in today’s article.

Once you have created your online store and set up everything you need to start selling your products or services, a HTTP 500 error (or internal server error) may appear. No need to panic!

However, we recommend that you take the time to resolve it, because if an error of this type persists over time, it can lead to serious losses for your company’s website, since it prevents users from browsing your site and therefore, purchasing your products.

But first of all, what is this error?

What is a HTTP 500 error?

A server displays a HTTP 500 error (or internal server error) when it cannot process a request, a request that should be correct in principle.

Since each server can use its own texts and terminology, the error message can take many forms.

Here are some of the most common error messages:

  • «Error 500 (Internal Server Error)»
  • «Error 500 — Internal server error»
  • «Internal server error»
  • «HTTP ERROR 500»
  • «Error 500»
  • «HTTP Error 500»

Of course, such an anomaly can be rather worrying if you own an online store and this store is your main source of income.

And for web developers, it’s a nightmare: a frantic race to get your site up and running again.

But how serious is a 500 error?

Although it sounds terrifying, encountering such a problem on your online store is not the end of the world.

In this article, we will explain how to fix it in your PrestaShop shop.

So next time, you will have nothing to worry about, and can act quickly to avoid delaying your sales any further!

How can I detect a HTTP 500 error in my PrestaShop shop?

In summary, this famous 500 error is the web server’s way of saying «Oops! An error has occurred, but we can’t tell you more.»

This is known as a server-side problem.

In other words, a failure has occurred within the hosting service which hosts the website.

This is a very general warning, usually due to problems with PHP settings, programming or website permissions.

In most cases, this glitch is accompanied by a rather brief explanation, similar to this one:

The server reported an unexpected error and cannot complete the client’ s request.

It is very important not to confuse it with the HTTP 404 error (page not found), that is also covered in this blog, and available to consult at any time.

Remember that this error can occur in any browser and operating system (so no, buying the new Apple Mac Pro will not prevent you from being confronted with it at some point. )

» Here is a screenshot with an example of how this error may be displayed:

How can I fix a HTTP 500 error on my online store website?

Although the error message is not very detailed, PrestaShop will give you more in-depth information about this problem.

Some servers, due to their configuration, often hide more specific error messages.

Therefore, if you have the same problem on your site and the error messages are too vague, you can activate your web host’s FTP or CPanel error reports in your PrestaShop shop.

There are 2 ways to enable these reports, depending on the version you are using:

» From PrestaShop v1.4 to v1.5.2

  1. Open config/config.inc.php
  2. On line 29, you will find this line: @ini_set(‘display_errors’,’off’);
  3. Replace it with: @ini_set(‘display_errors’,’on’);

» PrestaShop v1.5.3 and later versions (including 1.6 and 1.7)

  1. Open config/defines.inc.php
  2. On line 28, you will find this line: define(‘_PS_MODE_DEV_’, false);
  3. Replace it with: define(‘_PS_MODE_DEV_’, true);

Once error reports from the FTP or CPanel are activated, you can browse your store’s front or back office to find out what the problem is.

Also, if you cannot access your website due to error 500, you can enable the error report and refresh the page that failed to display.

You will then be provided more information that will help you to understand the causes and location of this incident.

What can cause an error 500?

Now that you have more information, you can use some of the standard tips below to deepen your understanding.

To begin, review the most common causes of the problem. If we know the cause of the problem, it is much easier to find the right solution and act accordingly.

The problem may be related to the following causes:

1. Permission error

In many cases, you will find that folder permissions are not set correctly.

To correct this error, simply set a file or folder authorisation to 755 instead of 777 (or vice versa).

In general, 777 permissions are incredibly unprotected and even an amateur hacker can enter your files and add harmful malware.

Check the specific permissions features with your host, as some servers use different rules.

2. Incorrect configuration of the.htaccess file

Internal server problems are often caused by a poorly configured .htaccess file.

As far as PrestaShop is concerned, the problems are generally related to URL re-writing options and activating «friendly URLs».

A .htaccess file’s format is very strict, and even an incorrect character or command could cause an internal 500 server error. Therefore, from the «friendly URLs» option, indicating «NO» could be a solution (don’t forget to save your changes).

We recommend that you backup your.htaccess file and restore it from the back office, or disable friendly URLs.

3. Waiting time has expired

Each server has its own waiting time, which determines how long a script will run.

If the function or script exceeds this time limit, you will receive a 500 error.

Here are the PrestaShop scripts that may take too long to load:

  • Importing CSV files.
  • Backup files.
  • Loading translations.
  • Import/export.
  • Regenerating miniature views.

In most cases, the server time limit is 30 seconds, which is not enough for these scripts.

In this case, you should contact your host and ask them to change this setting (at least temporarily).

4. Obsolete modules

When updating your shop (for example: if you upgrade from version 1.6 to version 1.7), you may encounter obsolete modules or modules that are incompatible with this new version of PrestaShop.

This can generate 500 errors. In this case, we will need to review all the Addons you have previously installed, or at least those that are available in a more recent version.

We recommend that you always have the official PrestaShop Marketplace page ready (or saved in your favourites), where you can obtain official modules, which are always up-to-date.

What if this HTTP 500 error persists in my shop once I have completed these checks?

In this case, you should consult the Apache and PHP error logs.

While some of these may be provided by your host, you may need to contact them directly to access the files.

«There are other solutions available on our forum»

Even if it seems obvious at first glance, when you receive specific PrestaShop information concerning the error or log file, you may want to do a Google search (focus on the problem and add the word «PrestaShop» to your search).

You will then find various information and tutorials for the type of error that occurred.

You will also certainly find discussions on the PrestaShop forum, entitled «[RESOLVED]».

Go through it carefully and, if after reading this post, you still haven’t been able to correct your error, be sure to register on the PrestaShop forums and ask for help.

With over a million members, you are sure to find answers to your questions, with the help of other users.

These will allow you to contact us, and to obtain additional assistance from one of our representatives.

Conclusion

At the beginning of this article, we told you that a HTTP 500 error or internal server error is not as bad as it seems.

Now you have the right tools to correct one of the most dreaded errors amongst Internet users.

Start your online store with the PrestaShop online software, and continue selling your products or services with total peace of mind!

Источник

Исправлением ошибок данного класса должен заниматься программист, системный администратор или продвинутый пользователь, который умеет читать тексты ошибок и понимает, как их исправлять.

Для начала надо получить конкретный текст ошибки, т.к. сообщение «500 Server Error» говорит лишь о наличии ошибки на сервере, но конкретно — ни о чём. Это сделано специально разработчиками PrestaShop, чтобы обычный пользователь (потенциальный покупатель в вашем интернет-магазине) не видел не понятного для него текста об ошибке, чтобы он не «пугался».

Сообщение «500 Server Error» отображается при условиях: режим отладки PrestaShop выключен, а сама ошибка относится к обрабатываемому классу ошибок: PrestaShopException. В этом случае, конкретный текст ошибки записывается в файл. В свежих версиях PrestaShop 1.7 для хранения описания ошибки создаётся файл в директории «/var/logs» с наименованием, содержащим дату, когда эта ошибка произошла, например, «20200929_exception.log» (произошла в 2020 году, 09 месяца, 29 числа). В старых версиях PrestaShop 1.7 директория с файлами находится в другом месте: «/app/logs». А в PrestaShop 1.6 и 1.5 — в директории «/log». Файл содержит список с детальным описанием ошибок, произошедших за ту же дату. Для каждой ошибки приводится следующая полезная информация: дата и время возникновения ошибки; текст ошибки; файл и номер строки, в которой она произошла. Пример описания ошибки в файле:

2020/09/29 — 14:04:25: Link to database cannot be established: SQLSTATE[08004] [1040] Too many connections at line 127 in file classes/db/DbPDO.php

В случае, когда режим отладки PrestaShop выключен, но сама ошибка не относится к обрабатываемому классу ошибок PrestaShopException, то будет отображена пустая страница (белый экран, как иногда говорят пользователи). В этом случае PrestaShop не запишет ошибку в файл, то есть, узнать, какая конкретно ошибка произошла у пользователя будет сложнее (для этого нужно изучать логи ошибок веб-сервера за определённую дату — не стану раскрывать данную тему в деталях; все панели управления имеют раздел, касающийся логов веб-сервера; путь к логам веб-сервера в каждой из операционных систем — отличается; веб-сервер может также быть использован разный, но зачастую, это Apache2).

Если вам известно, как воспроизвести ошибку (например, по словам пользователя), то вы можете включить режим отладки PrestaShop и выполнить порядок действий до обнаружения ошибки — в этом случае, она будет отображена уже на странице браузера. Причём, информация может быть дана более детальная (со стеком вызова методов/функций).

Для исправления ошибки нужно изучить: текст об ошибке, конкретную строку кода, где она произошла и принять решение по её исправлению. Для обычного пользователя — это довольно сложная задача. Поэтому у меня такой, довольно очевидный, совет: скопируйте текст ошибки и вставьте его в строку поиска поисковика (Google, Yandex), в начало добавив версию PrestaShop и само слово PrestaShop, например:

PrestaShop 1.7 Link to database cannot be established: SQLSTATE[08004] [1040] Too many connections at line 127 in file classes/db/DbPDO.php

Как правило, на частые ошибки PrestaShop, в сети находятся ответы. Если ошибка связана с коммерческим модулем, то в сети может не найтись достаточно информации для её исправления. Поэтому, если вы поняли по тексту ошибки, что она относится к определённому модулю, то вы можете обратиться к разработчику данного модуля за помощью.

Do you get any error named “500 error” during the installation of Prestashop or blank pages appear with the error Prestashop 500 error or any error 500 Prestashop, then this article is for you. With this guide, you will learn how to detect and solve Prestashop 500 error, an internal failure of the webserver. This kind of error occurs, especially when you start updating your site or module from a Prestashop store. When installing the module / or updating the site, it starts processing the configuration, so that time error occurs if something wrong happens. 

Prestashop 500 error

The 500 error is a problem that appears if there is an internal server failure because it cannot process the request. There is nothing to be panic about if Prestashop 500 error appears because it has the solution. The most common Prestashop 500 error is seen below: 

  1. Internal Server Error
  2. HTTP ERROR 500
  3. Error 500 (Internal Server Error)
  4. HTTP Error 500
  5. 500 Error

Common causes of that error happen:

  1. File / Folder Permission is wrong
  2. Wrong configuration of the .htaccess file
  3. Server timeout
  4. Low PHP memory
  5. PHP modules missing
  6. Backdated / Obsolete modules

What is Prestashop 500 error?

As we have explained before, although its name indicates that it is a server error, it is an error produced by an instruction that the server is not able to interpret, at the same time it can affect the robots (search engines) that reach a URL Without the information that should be found, it produces a rebound effect that logically in addition to affecting our audience will affect our organic positioning.

Where does the 500 error come from?

As we said, Prestashop 500 error is an internal server failure that appears when executing a request. It is neither more nor less than a message that warns that something is failing and not working as it should (on the webserver). Let’s not confuse terms because the 404 error, which is also very common, is due to a landing page that is no longer available or does not exist.

The disadvantage of this failure is that it can have several causes, so it is a bit difficult to find a suitable solution the first time and much more to get rid of it forever … what is certain is that it can be due to the following factors:

Waiting time. Servers have timeouts that determine how long a script that imports, exports, translates, or uploads backups runs for. If this limit is exceeded, it is usually 30 seconds, then the dreaded error 500 will appear.

.htaccess . If you have misconfigured this file then this bug appears. In fact, the misuse of friendly URLs causes internal problems in the webserver or if we have written the code wrong in .htaccess logically it leads us to have 500.

Folder permission. The 777 permission has a large number of weak points so it can corrupt the contents of the files in our folders and thus turn the good internal functioning of the server into a failure.

Programming error. It is usually the most common, a wrongly programmed line or one that conflicts with another store process is usually the most normal, when installing a module in Prestashop it usually happens very often.

Types of 500 internal server error

The types of Prestashop 500 error  classified into several types, generally each of them indicates a specific problem that will give us a clue of where we will have to look or how to solve the problem, all errors have the 5xx format, that is, within 500 several may appear that we indicate below:

Error 510: Not extendedUsually, it is a server problem, it is old, it has an internal failure, it has a virus, or it may even be that the server administrator has denied access, contact your provider.

How can we fix Prestashop 500 error?

Error 500 has no clue why it is happening. But each website has an error log. So we can observe the error log to find out the actual error. To enable the error log, we have to enable the debug mode. So let’s see how to enable debug mode for Prestashop. We must first have activated error reports of Prestashop when we surf the front-office and back-office, in our case our Prestashop store so check and locate the error safely, also known in Prestashop as debug mode or display mistakes.

Enable debug mode

If you have access to the admin panel ( back office ), then login in and CONFIGURE menu under Advanced Parameters > Performance > Debug Mode > Yes 

If you don’t have access and you have the most recent versions of Prestashop ranging from 1.5.3 to 1.7 you have to perform these steps:

  1. Go to config / defines.inc.php
  2. Find the line of code (‘_PS_MODE_DEV_’, false);
  3. Replace it with (‘_PS_MODE_DEV_’, true);

If instead, you continue with previous versions of Prestashop, peace of mind, follow these steps:

  1. Go to config / config.inc.php
  2. Find the line of code @ini_set(‘display_errors’, ‘off’);
  3. Replace it with @ini_set(‘display_errors’, ‘on’);

By activating the errors, we can exactly locate the root of the problem and know why it occurred, and take the reins to solve it, it will show us the lines of code where the problem is found in the case that it is due to some code. Go for the 500 error! The best thing is to prevent this, the best thing is to regularly review the error log that our server has, there is a file generally in txt format that indicates all those errors, with which we anticipate possible problems with the client If your server has CPANEL, for example, you have a log only for these errors.

As you can see, we can independently see the most common errors of a Prestashop 500 error, if your panel is Plesk or another, it is similar, all servers have help.

The solution to HTTP 500 bug

Your error may not come from the aforementioned causes, no problem since you now have more information with which to address the problem. After having made the pertinent diagnosis, we propose the following solutions based on the cause that caused it:

The Prestashop 500 error is due to the waiting time: We will have to increase that time for the scripts to run smoothly. If you have a service provider, you should contact him, change the parameter, and voilà ! Or optimize the source code so as not to overload the server.

The fault arises from htaccess: First of all, make a backup copy of the .htaccess file, then deactivate the friendly URLs or even regenerate the httacces, by default if you deactivate the friendly urls in Prestashop it will be regenerated automatically.

The code 500 is in the permission of the folders: Change the permission from 777 to 755 or 644. Sometimes we may have changed the permissions of a folder and that is why it has given us an error, Prestashop is very picky about the issue of security permissions.

Low PHP memory Limit: For Low PHP memory limit, the following errors occur: 

  • Fatal error: Allowed memory size
  • Error 500 during a large order
  • Prestashop 1.7.7.4 hangs when saving email translation

This kind of error happens due to a low PHP memory limit. In that case, we have to increase the PHP memory limit. Many websites default memory allocation 32 MB, 64MB, 128 MB. But Prestashop System requires a memory_limit minimum of 256M. 

To increase the PHP memory limit, log in to your hosting, go to yoursite_file, edit php.ini, and one new window will open. Increase the memory limit to 256M.

Missing PHP modules: When a site runs in a VPS, it’s usually found that PHP misses the required module. We need the following module to run the Prestashop site. 

  • OpenSSL
  • Mcrypt
  • Curl
  • Zip
  • GD
  • PDO

Backdated / Obsolete modules: When you update the Prestashop version, you may face error modules that are incompatible with the new version of Prestashop. It can generate Prestashop 500 error. So you have to review all the Addon you have installed. It’s recommended to install the software from the Prestashop marketplace. There is always up-to-date software available

Is the Prestashop 500 error not fixed? What now?  

If the Prestashop 500 error is not fixed, then don’t worry. We are here to resolve the issue. Our Prestashop expert will fix the issue. It will take a shorter time to log the problem and fix the issue. If you feel any issues to apply the above process, feel free to explore our PrestaShop Development Services.

Read More:

How to enable SSL on prestashop

500 Internal Server Error is one of the common PHP errors that can put a PHP developer in panic mode. This article provides information on the most common causes. Why it become common PHP errors ? because you will found this error in WordPress, Prestashop, Codeigniter, Java, ASP.NET or whatever.

500 Internal Server Error is not a client side problem. It’s up to the sysadmin of the Web server site to locate and analyse the logs which should give further information about the error. Based on Wikipedia, 500 Internal Server Error is A generic error message, given when an unexpected condition was encountered and no more specific message is suitable.

Here are several common ways that you might see the HTTP 500 error:

  • “500 Internal Server Error”
  • “HTTP 500 – Internal Server Error”
  • “Temporary Error (500)”
  • “Internal Server Error”
  • “HTTP 500 Internal Error”
  • “500 Error”
  • “HTTP Error 500”
  • “500. That’s an error”

HOW TO FIX THE 500 INTERNAL SERVER ERROR

CHECK YOUR SERVER ERROR LOGS

With any error message, particularly one as broad as the 500 Internal Server Error, you will first want to check any Apache and PHP error logs for your server. These logs can provide valuable context related to any code failures or other potential causes of a site failure.

ERROR WITH AN .HTACCESS FILE

If you are using a .htaccess on your site, it may be interfering with the web page you are trying to load into your browser. Please double check the .htaccess configuration. Any syntax errors will cause a 500 Internal Server Error message to be displayed instead of your website.

To confirm whether a misconfiguration .htaccess is the cause of the 500 Internal Server error, either remove or rename the .htaccess file temporarily and then try to reload the page.

If your PHP script makes external network connections, the connections may time out. If too many connections are attempted and time out, this will cause a “500 Internal Server Error.” To prevent these time outs and errors, you’ll want to make sure that PHP scripts be coded with some timeout rules. Typically, however, catching a timeout error when connecting to a database or externally to remote resources (example: RSS feeds) are difficult. They, in effect, freeze the script from continuing to run.

Removing any external connections can increase both the performance of your website and decrease the chances of you receiving a “500 Internal Server Error.”

SYNTAX OR CODING ERRORS IN YOUR CGI/PERL SCRIPT

If it is a web page ending in .cgi or .pl that is producing the error, check your script for errors.

CGI Script Guidelines

When editing your CGI script, use a plain text editor – a program that saves the file as a ‘text file’ type. DO NOT use Wordpad that comes with Microsoft Windows because it doesn’t save files in pure ASCII text format. Use Notepad instead to edit files.
Upload your CGI scripts in ASCII mode into the cgi-bin directory.
Set the file permissions on the CGI script file and directories to be chmod 755. If you use an FTP program to transfer files, right-click on the file and select change file attributes.
Double-check that the Perl modules you require for your script is supported.

Troubleshoot as a 504 Gateway Timeout error instead.

It’s not very common, but some servers produce a 500 Internal Server Error when in reality a more appropriate message based on the cause of the problem is 504 Gateway Timeout.

Delete your browser’s cookies

Some 500 Internal Server Error issues can be corrected by deleting the cookies associated with the site you’re getting the error on. After removing the cookie(s), restart the browser and try again.

How To Fix the 500 Internal Server Error PrestaShop

There are two ways to turn on Error Reporting in PrestaShop depending on what version you have.

For PrestaShop v1.4 through v1.5.2

  1. Open config/config.inc.php
  2. On or around line 29 you will find this line
    @ini_set('display_errors', 'off');
  3. Change that line to read
    @ini_set('display_errors', 'on');

For PrestaShop v1.5.3+

  1. Open config/defines.inc.php
  2. On or around line 28 you will find this line
    define('_PS_MODE_DEV_', false);
  3. Change that line to read
    define('_PS_MODE_DEV_', true);

Once you enable error reporting through your FTP or CPanel, you can navigate back to your PrestaShop’s front or back office and reproduce the error or issue you are having. For example, if you are not able to access your website because of the 500 error, you will need to turn on error reporting and refresh the page(s) that had the error. There will be additional information that you can use to investigate the problem.

How To Fix the 500 Internal Server Error WordPress

Checking for Corrupt .htaccess File

The first thing you should do when troubleshooting the internal server error in WordPress is check for the corrupted .htaccess file. You can do so by renaming your main .htaccess file to something like .htaccess_old. To rename the .htaccess file, you will need to login to your site using the FTP. Once you are in, the .htaccess file will be located in the same directory where you will see folders like wp-content, wp-admin, and wp-includes.

Once you have renamed the .htaccess file, try loading your site to see if this solved the problem. If it did, then give yourself a pat on the back because you fixed the internal server error. Before you move on with other things, make sure that you go to Settings » Permalinks and click the save button. This will generate a new .htaccess file for you with proper rewrite rules to ensure that your post pages do not return a 404.

If checking for the corrupt .htaccess file solution did not work for you, then you need to continue reading this article.

Increasing the PHP Memory Limit

Sometimes this error can happen if you are exhausting your PHP memory limit. Use our tutorial on how to increase PHP memory limit in WordPress to fix that.

If you are seeing the internal server error only when you try to login to your WordPress admin or uploading an image in your wp-admin, then you should increase the memory limit by following these steps:

  1. Create a blank text file called php.ini
  2. Paste this code in there: memory=64MB
  3. Save the file
  4. Upload it into your /wp-admin/ folder using FTP

Several users have said that doing the above fixed the admin side problem for them.

If increasing the memory limit fix the problem for you, then you have fixed the problem temporarily. The reason why we say this is because there has to be something that is exhausting your memory limit. This could be a poorly coded plugin or even a theme function. We strongly recommend that you ask your WordPress web hosting company to look into the server logs to help you find the exact diagnostics.

If increasing the PHP memory limit did not fix the issue for you, then you are in for some hard-core trouble shooting.

How To Fix the 500 Internal Server Error Codeigniter

Check your error logs, sometimes the problem is with file permission, so make sure your file permission is 0755.

Read also:

[SOLUTIONS] 502 Bad Gateway Error on Nginx

[SOLUTIONS] 504 Gateway Timeout Nginx

Sources:

500 Internal Server Error – pcsupport.about.com
WHY AM I GETTING A 500 INTERNAL SERVER ERROR MESSAGE? – mediatemple.net
The 500 Internal Server Error Explained Solved

The Background

I upgraded my ubuntu server last week and after I did so, the Prestashop front end went down – but not the back end! Everything seemed fine because no one was checking the front end so after someone changed something in the back and refreshed the front they thought they had killed the site (and so did I!). However, it just so happened that I had taken a backup (thankfully) and then upgraded the ubuntu server which – apparently – took the PHP version from 7.3 to 7.4 which Prestashop wasn’t ready for…

After turning on debug mode in the PS backend to ‘yes’ in Advanced Parameters / Performance (nice tool by the way…), I started getting a lot of this:

Deprecated: array_key_exists(): Using array_key_exists() on objects is deprecated. Use isset() or property_exists() instead in /var/www/shop/src/Adapter/EntityMapper.php on line 99

and a lof of this:

(1/1) ContextErrorException

Notice: Trying to access array offset on value of type bool

I did all of the following and it took an entire week:

  • Downgraded php to 7.3 at which point I got this error:

[PrestaShopException]

Link to database cannot be established: SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client
at line 136 in file classes/db/DbPDO.php

  • Downgraded php to 7.2
  • Downgraded mysql to 5.7 with the help of this blog
  • Reversed all of the above
  • Tried creating a brand new mysql database and importing the old one into it with the help of This blog and this command (adjusted accordingly): sudo mysql -u prestshopusername -p prestashop_db_name < location/to/backup/filename.sql
  • Tried every combination of PHP known to man…
    • Wiped server back to a nearly new state: sudo apt-get full-upgrade with

Take-Away Lesson 1

Know the release dates of PHP and MySQL and your Operating system before going down such a road. This would have helped troubleshoot a little…

Take-Away Lesson 2

Another take-away point for ‘later reading’ is the order of workflow I was doing. When moving stuff around servers it was recommended this order which I will consider moving forward:

  1. Move your files (Prestashop files) to the new location / server / whatever
  2. Create a new MySql database (I never did this…)
  3. Import the backup PS database into the new database
  4. Update the config files.

Take-Away Lesson 3

Prestashop has a killer good upgrade module called 1-click upgrade. This blog explains the upgrade options well.

Solution

Fixing the PHP issue was indeed the fix. So here are the steps to save you the total utter pain I went through:

  1. confirm your php version: php -v
    If it’s 7.4 or higher (and your Prestashop is 1.7 or lower), you’ll need to go back to 7.3 (at least).
  2. Go back to 7.3
  3. Install the packages:
    sudo apt install libapache2-mod-php7.3 php7.3 php7.3-common php7.3-curl php7.3-gd php7.3-imagick php7.3-mbstring php7.3-mysql php7.0-json php7.3-xsl php7.3-intl php7.3-zip php7.3-fpm
  4. Downgrade:
    This is a good downgrading blog but it doesn’t include this option which is worth further investigation as it ‘may’ not require all these commands: sudo update-alternatives --config php So do a bit of further study on this part I would recommend. Plus I would consider using my command for installing it since it has the Prestashop modules:
  5. Disable 7.4 (covered in blog above)
  6. Enable 7.3 (covered in blog above)
  7. Restart apache2 (covered in blog above)
  8. Confirm you are back to 7.3 with php -v
  9. Do a fancy-dancy command extracted from this blog in conjunction with this blog:

ALTER USER '---'@'localhost' IDENTIFIED WITH mysql_native_password BY '---';

I believe (although too busy to confirm…) that the above command actually deals with the new way that mysql 8 deals with password encryption. So if you are on a different version of MySQL this command ‘may’ not be required. I just wanted to write this because this one is not related to php by instead mysql and may require a bit more research in your case…

Of course this command above presumes you magically know what to do (which I didn’t) so what you need to do is login to MySql with your secure login stuff (if applicable) (as root) and then run the command updating to your prestashop stuff. Pay attention to the following two notes/tips:

Note 1: Use the same username here as the one controlling your prestashop database
Note 2: use the same password as the one controlling your prestashop database

10. Refresh your browser to see if you can access your back and front end of Prestashop.

Tip 1: Still having problems reaching your admin page even though you are sure you’re going there? Make sure all the ‘stuff’ after index.php in the URL field are removed and try again

Still not working? Try a control + R or control + F5.

Still not working? Try in a new browser tab.

Hope this helps!

Tagged #prestashop, 500, mysql, tutorial, Ubuntu

Понравилась статья? Поделить с друзьями:
  • Pressure accumulator charging порше кайен как исправить
  • Press start button again ошибка киа
  • Press online sw error postscript oki b432
  • Press f2 to load default values and continue как исправить
  • Press f1 to run setup при включении как исправить ошибку