When working with OpenCart, or any program, there is always the possibility for errors to occur. This article describes a particular error in OpenCart that occurs when placing the OpenCart site into maintenance mode due to a missing maintenance.php file. This results in a blank screen with “Error: Could not load language common/maintenance!” at the top, provided you have the display error message feature enabled. Follow the instructions below as we guide you on how to fix this error in your OpenCart 1.5 store.
Could not load language common/maintenance! Error
- Log into your cPanel.
- From the main cPanel area, look for and open the File Manager tool.
- Navigate to your OpenCart program’s root folder. For most, this will be the public_html folder. If you are using a subfolder (example.com/shop) you would need to enter that folder (public_html/shop).
- Now that you are in the root folder, we must navigate to the folder where the missing file needs to be included. This is under the catalog/language/english/common folder. Note: if you are using a language other than english, then be sure to use the apporpriately named folder for that language.
- Once inside the folder, you should notice there is no maintenance.php file. We will need to create one. Click on the New File button from the toolbar at the top of the screen.
- Name the new file maintenance.php and click on the Create New File button.
- The screen will refresh and you will see the file in the folder. Highlight the file and open it for editing.
- Now that you are in the file editor, copy and paste the following code in it to create a default maintenance page.
$_[‘heading_title’] = ‘Maintenance’; // Text
$_[‘text_maintenance’] = ‘Maintenance’;
$_[‘text_message’] = ‘<h1 style=”text-align:center;”>
We are currently performing some scheduled maintenance. <br/>
We will be back as soon as possible. Please check back soon.</h1>’;
- Click the Save Changes button in the upper right to save the new file content. Now, your maintenance mode should display properly instead of getting the “Error: Could not load language common/maintenance!” message.