Move the storage directory outside of the web directory

Alamgir Khan picture Alamgir Khan · Feb 12, 2018 · Viewed 10.8k times · Source

In opencart version 3 there is a notification:

It is very imporant that you move the storage directory outside of the web directory (e.g. public_html, www or htdocs)

Screenshot Screenshot

I tried by clicking on move button in the picture also tried manually but after trying it is giving weird errors.

Answer

Ziauz picture Ziauz · Feb 17, 2018

You can move storage directory outside of the web directory (e.g. public_html, www or htdocs) in three ways

  1. Automatically Moving
  2. Manual Moving (from admin panel)
  3. Manual Moving ( By editing Config files)...

Assuming that you know first and second methods.Here I will explain the third method to you.

  1. Copy your storage directory from system/storage to public_html, www or htdocs.
  2. Change the following file path from both config files i.e. config.php and admin/config.php as shown below.

    define('DIR_STORAGE', 'public_html/storage');

Please replace public_html to your desired path.

I hope this answer might help you.