Common OpenCart Errors
Detailed guide to dealing with the most common problems in your OpenCart store
White Screen of Death
The white screen is one of the most common problems on OpenCart and is usually caused by a PHP error that prevents loading the page.
How to fix it:
- Enable PHP error display
- Add to file
config.phpOpenCart: ini_set('display_errors', 1);ini_set('display_startup_errors', 1);error_reporting(E_ALL);
- Add to file
- Check php.ini file
- Configure
display_errors = On - Increase it
memory_limitat least 128M - Configure
max_execution_time300 or more
- Configure
- Check log files - Look at him our guide to log files
Important advice:
After solving the problem, remember to disable the occurrence of errors from the productive environment for security reasons.
Errors Linking to the Database
Database connection problems usually occur in the form of messages such as "Error establishing database connection" or "Could not make a database link".
Possible solutions:
- Check connection data - Make sure the data in the file
config.phpis correct (user name, password, base name, server) - Confirm the database works - Check if the MySQL/MariaDB server is active
- Check user rights - Make sure the database user has the necessary permissions
- Contact the hosting provider - Maybe there is a problem with the server
Common PHP Errors
1. PHP Notices
PHP alerts do not interrupt the operation of the store, but indicate possible problems in the code.
Notice: Undefined variable: product in /path/to/file.php on line 123 This means the code is trying to use a variable that has not been defined. Usually it does not affect functionality but it is good practice to correct.
2. PHP Warnings
Warnings are more serious than notifications, but they still do not interrupt the operation of the store.
Warning: include(missing_file.php): failed to open stream: No such file or directory in /path/to/file.php on line 456 That means the code is trying to include a file that doesn't exist.
3. PHP Fatal Errors
Critical errors interrupt the script execution and usually cause white screen or partial loading of the page.
Fatal error: Uncaught Error: Call to undefined function missing_function() in /path/to/file.php:789 That means the code is trying to call a function that doesn't exist. Usually it happens when a PHP extension is missing or the code has been incorrectly modified.
Important note:
For security reasons, it is good to disable PHP errors in the production environment (live site) and enable error recording in a file instead of showing in the browser.
Problems with Extensions and Amendments
1. Errors after installing extension
If you experience problems immediately after installing an extension:
- Remove the extension temporarily to confirm that it causes the problem
- Check the compatibility of the extension with your OpenCart version
- Clear the OpenCart cache (from the management or delete the contents of the cache folder)
- Check the file
ocmod.logfor possible installation errors
2. Errors with OCMOD/vQmod
OCMOD and vQmod modification systems can cause problems if they are not correctly adjusted:
- Refresh the modifications from the admin (Extensions > Modifications > Refresh)
- Check for conflicts between different changes
- In case of serious problem, disable all modifications and activate one by one
Upgrading Problems
OpenCart upgrades can sometimes cause problems:
Common errors and solutions:
- Missing Files - Make sure you have uploaded all the files of the new version
- Problems with the database - Check if all necessary database updates have been performed
- Conflicts with modified files - If you have made adjustments to the code, you may need to reapply them after the upgrade
- Incompatibilities of extensions - Some extensions may not be compatible with the new version
Good practices for upgrades:
- Always create full backup before upgrade
- Try upgrading first in a test environment
- Update all your extensions to the latest versions
- Read carefully the update notes of the new version
File Rights Errors
Many problems in OpenCart are due to incorrect file and folder rights:
Folders requiring registration rights:
system/storage/And all his subfoldersimage/And all his subfoldersconfig.php(during installation)admin/config.php(during installation)
Recommended rights:
- Folders: 755 (or 775 if required by server)
- Files: 644 (or 664 if required by server)
You can change the rights via FTP or by File Manager of your hosting.
You didn't find a solution to your problem?
OpenCart Greece's specialized support team is ready to help you with any technical problems you face.