How to Fix OpenCart Admin Redirects to Install?

Sometimes installation window appears when trying to get into the admin panel of the Opencart store. The reason is most likely about /admin/config.php file. The one either has wrong permissions or contains no data. The following steps should be performed to resolve the issue:

Fix OpenCart Admin Redirects to Install

Incorrect permissions

  1. Open your Opencart Default directory via File Manager or FTP access and access ‘admin’ folder.
  2. Locate ‘config.php’ file in the admin folder. Change its permissions to be 644 or 666.

Empty /admin/config.php file

  1. Open your Opencart Default directory via File Manager or FTP access and access ‘admin’ folder.
  2. Locate ‘config.php’ file in the admin folder and open the file with any code editor to view its content.
  3. Most likely it will be empty or incomplete.
  4. You should place the required content into the file. It has to contain store links and database specification. You can refer below code to get file applied properly for your own store, the following updates are required:
     // HTTP
     define('HTTP_SERVER', 'http://your_website_url/admin/');
     define('HTTP_CATALOG', 'http://your_website_url/');
     // HTTPS
     define('HTTPS_SERVER', 'http://your_website_url/admin/');
     define('HTTPS_CATALOG', 'http://your_website_url/');
     // DIR
     define('DIR_APPLICATION', '/server_files_directory/admin/');
     define('DIR_SYSTEM', '/server_files_directory/system/');
     define('DIR_IMAGE', '/server_files_directory/image/');
     define('DIR_LANGUAGE', '/server_files_directory/admin/language/');
     define('DIR_TEMPLATE', '/server_files_directory/admin/view/template/');
     define('DIR_CONFIG', '/server_files_directory/system/config/');
     define('DIR_CACHE', '/server_files_directory/system/storage/cache/');
     define('DIR_DOWNLOAD', '/server_files_directory/system/storage/download/');
     define('DIR_LOGS', '/server_files_directory/system/storage/logs/');
     define('DIR_MODIFICATION', '/server_files_directory/system/storage/modification/');
     define('DIR_UPLOAD', '/server_files_directory/system/storage/upload/');
     define('DIR_CATALOG', '/server_files_directory/catalog/');
     // DB
     define('DB_DRIVER', 'mysqli');
     define('DB_HOSTNAME', 'hostname');
     define('DB_USERNAME', 'database_username');
     define('DB_PASSWORD', 'database_password');
     define('DB_DATABASE', 'database_name');
     define('DB_PORT', '3306');
     define('DB_PREFIX', 'oc_');​

    1. Replace all instances of your_website_url with the actual URL of your website (without www).
      NOTE: If the template is installed to the subfolder, its title should be mentioned for all directories as well.
    2. Directories for files are specified here as well. Therefore all instances of server_files_directory should be replaced with the actual path to your site files in the server. Open the "config.php" file in the root to copy valid path.
    3. Specify the database information (DB driver, DB hostname, DB name, DB user, and DB password). Corresponding details can be taken from the "config.php" file in the root.
      Save the /admin/config.php file once all updates are completed.
  5. Get back to the root server files now. Find ‘Install’ folder there. This should be renamed/ or removed to prevent reinstallation.

If you check the admin directory now, you should get it working properly. If you face any problems or need our professional services, please email us at [email protected]

Join our Newsletter

Never miss the latest offers, voucher codes and useful articles delivered weekly in your inbox.