PrestaShop Error Codes Explained: 403, 404, 500 and 503

414 views

Understanding HTTP Error Codes in PrestaShop

HTTP error codes are standardized responses from your web server that indicate something went wrong when a browser or search engine bot tried to access a page. For PrestaShop store owners, these errors can mean lost sales, frustrated customers, and damaged SEO rankings. Understanding what each code means and how to fix it is essential for maintaining a healthy online store.

This guide covers the four most common HTTP errors you will encounter with PrestaShop - 403, 404, 500, and 503 - with detailed explanations of their causes and step-by-step solutions for each.

Error 403 - Forbidden

A 403 error means the server understood your request but refuses to authorize it. The server is saying "I know what you want, but I will not give it to you." This is typically a permissions or access control issue.

Common Causes in PrestaShop

1. Incorrect File and Directory Permissions

PrestaShop requires specific file permissions to function correctly. Directories should be set to 755 (read, write, execute for owner; read and execute for group and others) and files should be set to 644 (read and write for owner; read for group and others).

# Fix permissions via SSH
find /var/www/html/prestashop -type d -exec chmod 755 {} \;
find /var/www/html/prestashop -type f -exec chmod 644 {} \;

# Ensure web server user owns the files
chown -R www-data:www-data /var/www/html/prestashop

2. .htaccess Rules Blocking Access

An overly restrictive .htaccess file can block legitimate requests. Check for rules that deny access based on IP addresses, user agents, or file patterns. Common problematic rules include -

# This blocks everyone - remove or modify it
Deny from all

# This might block legitimate bots
RewriteCond %{HTTP_USER_AGENT} ^$ [OR]
RewriteCond %{HTTP_USER_AGENT} ^-

3. ModSecurity or WAF Blocking Requests

Web Application Firewalls (WAF) like ModSecurity, Sucuri, or Cloudflare can produce false positives, blocking legitimate admin requests or module operations. Check your hosting control panel for security logs that show blocked requests.

4. IP-Based Access Restrictions

Some hosting providers or security configurations restrict access to the admin panel based on IP addresses. If your IP has changed, you may be locked out.

How to Fix 403 Errors

  1. Check and fix file permissions (755 for directories, 644 for files)
  2. Review your .htaccess file for overly restrictive rules
  3. Check hosting security logs for WAF blocks
  4. Verify your IP is not on a blocklist
  5. If all else fails, temporarily rename .htaccess to .htaccess_backup and test

Error 404 - Not Found

A 404 error means the server cannot find the requested page. The URL points to a resource that does not exist or has been moved without a proper redirect.

Common Causes in PrestaShop

1. Disabled or Misconfigured Friendly URLs

PrestaShop's friendly URLs feature rewrites technical URLs (like index.php?id_product=42&controller=product) into clean URLs (like /shower-drain-600mm.html). If friendly URLs are enabled but the .htaccess file is missing or misconfigured, every friendly URL will return a 404.

Fix - Go to Shop Parameters > Traffic & SEO, ensure Friendly URLs is enabled, and click Save. This regenerates the .htaccess file. If that does not work, check that the Apache mod_rewrite module is enabled on your server.

2. Deleted Products or Categories Without Redirects

When you delete a product or category in PrestaShop, the URL stops working but may still be indexed by Google or linked from other sites. Always set up 301 redirects when removing content.

In PrestaShop, go to the product editing page and under the SEO tab, set the redirect type to "301 - Moved permanently" and choose a target product or category.

3. Changed URL Structure

If you change the URL format pattern (e.g., from {rewrite}.html to {rewrite}), all existing URLs will break. Set up redirects for the old patterns.

4. Missing or Corrupted .htaccess

A missing .htaccess file means Apache does not know how to handle PrestaShop's URL rewriting, resulting in 404 errors for all non-default URLs.

# Generate a fresh .htaccess by visiting
# Shop Parameters > Traffic & SEO and clicking Save
# Or manually copy the default .htaccess from a fresh PrestaShop install

5. Module URLs Not Working

Some modules register custom front-end controllers with their own URLs. If the module is disabled or improperly installed, those URLs will return 404s.

How to Fix 404 Errors

  1. Verify .htaccess exists and is properly configured
  2. Check that mod_rewrite is enabled on your server
  3. Regenerate the .htaccess from Shop Parameters > Traffic & SEO
  4. Set up 301 redirects for deleted or moved content
  5. Check Google Search Console for crawl errors and fix them systematically

Error 500 - Internal Server Error

A 500 error is the most generic and most frustrating server error. It means something went wrong on the server side, but the server cannot be more specific about what the problem is. This is PrestaShop's "something broke" message.

Common Causes in PrestaShop

1. PHP Memory Limit Exceeded

PrestaShop requires significant PHP memory, especially with many modules installed. If the memory limit is too low, operations will fail with a 500 error.

# In php.ini, increase the memory limit
memory_limit = 512M

# Or in .htaccess
php_value memory_limit 512M

# Or in .user.ini for PHP-FPM
memory_limit = 512M

2. PHP Syntax Errors or Fatal Errors

A bug in a module, theme, or PrestaShop core file can cause a PHP fatal error. To diagnose, enable error display temporarily -

# In config/defines.inc.php, change:
define('_PS_MODE_DEV_', false);
# To:
define('_PS_MODE_DEV_', true);

This will display the actual PHP error instead of a generic 500 page. Remember to disable this after debugging as it exposes sensitive information.

3. Corrupted or Incompatible .htaccess

An .htaccess file with invalid directives will cause Apache to return a 500 error for every request. Test by temporarily renaming the file.

4. PHP Version Incompatibility

PrestaShop versions have specific PHP requirements. Running PrestaShop 1.7 on PHP 8.2+ or PrestaShop 8.x on PHP 7.1 will cause fatal errors. Check the compatibility matrix -

PrestaShopPHP MinimumPHP Recommended
1.7.x7.17.4
8.x7.28.1
9.x8.18.2+

5. Database Connection Issues

If PrestaShop cannot connect to the MySQL database, it will show a 500 error. Check app/config/parameters.php (or config/settings.inc.php for older versions) to verify the database credentials are correct.

6. Module Conflicts

A newly installed or updated module can cause 500 errors. If you cannot access the admin panel, disable the module via FTP by renaming its folder.

# Rename the problematic module folder
mv modules/problematic_module modules/problematic_module_disabled

7. Max Execution Time Exceeded

Long-running operations (product imports, large catalog operations) can exceed the PHP max execution time and trigger a 500 error.

# In php.ini
max_execution_time = 300
max_input_time = 300

How to Fix 500 Errors

  1. Enable debug mode to see the actual error
  2. Check the PHP error log (location varies by hosting)
  3. Check the PrestaShop error log at /var/logs/
  4. Test with a renamed .htaccess file
  5. Increase PHP memory limit and execution time
  6. Verify PHP version compatibility
  7. Disable recently installed or updated modules
  8. Verify database connection settings

Error 503 - Service Unavailable

A 503 error means the server is temporarily unable to handle the request. This is often a capacity or maintenance issue.

Common Causes in PrestaShop

1. Maintenance Mode Still Active

After performing maintenance, if you forget to disable maintenance mode, customers will see a 503 error (or maintenance page). PrestaShop sometimes does not properly clear maintenance mode after an upgrade.

Fix - Go to Shop Parameters > General > Maintenance and disable it. If you cannot access the admin, change the value directly in the database -

UPDATE ps_configuration SET value = '0' WHERE name = 'PS_SHOP_ENABLE';

2. Server Overload

During traffic spikes (sales events, viral social media posts), your server may not have enough resources to handle all requests. Solutions include -

  • Upgrading your hosting plan
  • Enabling PrestaShop's built-in caching
  • Using a CDN like Cloudflare
  • Optimizing database queries
  • Enabling OPcache for PHP

3. PHP-FPM Worker Exhaustion

If all PHP-FPM workers are busy processing requests, new requests will receive a 503 error. This is common on shared hosting or underprovisioned VPS servers.

# In php-fpm pool configuration
pm = dynamic
pm.max_children = 50
pm.start_servers = 10
pm.min_spare_servers = 5
pm.max_spare_servers = 20

4. Failed Update Leaving Residual Files

A failed PrestaShop update can leave the store in a broken state with a 503 error. Check for a maintenance file in the root directory and delete it if present.

5. Cron Jobs or Heavy Operations

Scheduled tasks like product imports, sitemap generation, or email sending can temporarily overload the server. Schedule heavy operations during off-peak hours.

How to Fix 503 Errors

  1. Check if maintenance mode is enabled and disable it
  2. Monitor server resources (CPU, RAM, disk I/O)
  3. Check PHP-FPM logs for worker exhaustion
  4. Review cron job scheduling for conflicts
  5. Consider upgrading hosting if traffic has grown
  6. Enable caching and optimize performance

General Debugging Tips for All Errors

Check Server Logs

The most reliable way to diagnose any error is to check the server logs -

  • Apache error log - /var/log/apache2/error.log
  • Nginx error log - /var/log/nginx/error.log
  • PHP-FPM log - /var/log/php-fpm/error.log
  • PrestaShop log - /var/logs/ in your PrestaShop directory

Enable PrestaShop Debug Mode

For 500 errors especially, enabling debug mode is the fastest way to identify the problem. Edit config/defines.inc.php and set _PS_MODE_DEV_ to true.

Test in a Clean Environment

If you suspect a module conflict, try disabling all non-essential modules and re-enabling them one by one to isolate the culprit.

Clear All Caches

After any fix, clear all caches - PrestaShop cache, OPcache, CDN cache, and browser cache. Stale cached data is a common source of persistent errors after a fix has been applied.

For more details, read our guides: Debugging PrestaShop: The Complete Developer Toolkit and PrestaShop .htaccess: Security and Performance Rules You Need.

Was this answer helpful?

Still have questions?

Can't find what you're looking for? Send us your question and we'll get back to you quickly.

Loading...
Back to top