Post by krzyniarz » Thu Oct 19, 2017 8:26 am

Hi guys,

Need some help here, I accidently overwrote config.php on root directory.
I managed to find the sample config on giy hub, I replaced the path but website is still not loading giving HTT{ 500 error page.

Strange thing is that a back end works perfect, just the front end is not.

https://github.com/W0lfw00d/opencart/co ... de1be9676c

Newbie

Posts

Joined
Thu Oct 19, 2017 7:23 am

Post by OpenCart Addons » Fri Oct 20, 2017 7:15 am

The frontend and backend have their own config file, which is why your backend is still working.
The config file on Github is blank. The config file contents are generated during the install process.

I recommend backing up your database and running the OC installer again. After the installation, you can restore your current database to get your products/categories/orders/etc. back.

Regards,
Joel.

Canada's Leading Expert In OpenCart Development & Certified OpenCart Development Partner Image


User avatar
Active Member

Posts

Joined
Thu Nov 24, 2011 10:51 am
Location - Canada

Post by straightlight » Fri Oct 20, 2017 10:06 am

There is no need to reinstall Opencart for missing configurations. By simply creating a sub-folder from the root and adding an empty index.html file into that sub-directory to protect your folder including a PHP file that provides paths should do it with the following code to add into the PHP file:

Code: Select all

<?php
// DIR
define('DIR_APPLICATION', str_replace('\\', '/', realpath(dirname(__FILE__))) . '/');
define('DIR_SYSTEM', str_replace('\\', '/', realpath(dirname(__FILE__) . '/../')) . '/system/');
define('DIR_OPENCART', str_replace('\\', '/', realpath(DIR_APPLICATION . '../')) . '/');
define('DIR_DATABASE', DIR_SYSTEM . 'database/');
define('DIR_LANGUAGE', DIR_APPLICATION . 'language/');
define('DIR_TEMPLATE', DIR_APPLICATION . 'view/template/');
define('DIR_CONFIG', DIR_SYSTEM . 'config/');
define('DIR_MODIFICATION', DIR_SYSTEM . 'modification/');
define('DIR_STORAGE', DIR_SYSTEM . 'storage/');
define('DIR_CACHE', DIR_STORAGE . 'cache/');

echo 'DIR_APPLICATION: ' . DIR_APPLICATION . '<br />';
echo 'DIR_SYSTEM: ' . DIR_SYSTEM . '<br />';
echo 'DIR_OPENCART: ' . DIR_OPENCART . '<br />';
echo 'DIR_DATABASE: ' . DIR_DATABASE . '<br />';
echo 'DIR_LANGUAGE: ' . DIR_LANGUAGE . '<br />';
echo 'DIR_TEMPLATE: ' . DIR_TEMPLATE . '<br />';
echo 'DIR_CONFIG: ' . DIR_CONFIG . '<br />';
// This one might be tricky if you moved your storage folder.
echo 'DIR_MODIFICATION: ' . DIR_MODIFICATION . '<br />';
echo 'DIR_STORAGE: ' . DIR_STORAGE . '<br />';
echo 'DIR_CACHE: ' . DIR_CACHE . '<br />';
?>
Then, once all the path captured in order to place them into your config.php file and admin/config.php file (with some additions to the admin/config.php compared to the root config.php), remove the PHP file showing these paths for protection purposes.

There are also several tips that can be followed from StackOverFlow.com for capturing constants: https://stackoverflow.com/questions/188 ... e-constant

The most generated errors being found on Opencart forum originates from contributed programming. The increased counters are caused by posted redundancies of the same solutions that were already provided prior.

F. Rules:

- viewtopic.php?f=176&t=200480
- viewtopic.php?f=176&t=200804


Regards,
Straightlight


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by tony2011 » Sat Apr 14, 2018 6:48 am

I am still struggling to get this working :-(.... I have done exactly what you recommend and now it lists more errors ... any advice?

Warning: fopen(/var/sites/t/domainame.co.uk/Storage_1//var/sites/t/domainame.co.uk/public_html/system/storage/cache/cache.catalog.language.1523663156): failed to open stream: No such file or directory in /var/sites/t/domainame.co.uk/public_html/system/library/cache/file.php on line 49Warning: fwrite() expects parameter 1 to be resource, boolean given in /var/sites/t/domainame.co.uk/public_html/system/library/cache/file.php on line 53Warning: fflush() expects parameter 1 to be resource, boolean given in /var/sites/t/domainame.co.uk/public_html/system/library/cache/file.php on line 55Warning: fclose() expects parameter 1 to be resource, boolean given in /var/sites/t/domainame.co.uk/public_html/system/library/cache/file.php on line 59Warning: fopen(/var/sites/t/domainame.co.uk/Storage_1//var/sites/t/domainame.co.uk/public_html/system/storage/cache/cache.currency.1523663156): failed to open stream: No such file or directory in /var/sites/t/domainame.co.uk/public_html/system/library/cache/file.php on line 49Warning: fwrite() expects parameter 1 to be resource, boolean given in /var/sites/t/domainame.co.uk/public_html/system/library/cache/file.php on line 53Warning: fflush() expects parameter 1 to be resource, boolean given in /var/sites/t/domainame.co.uk/public_html/system/library/cache/file.php on line 55Warning: fclose() expects parameter 1 to be resource, boolean given in /var/sites/t/domainame.co.uk/public_html/system/library/cache/file.php on line 59

New member

Posts

Joined
Tue Jun 14, 2011 4:42 am

Post by straightlight » Sat Apr 14, 2018 7:59 am

No need to post it twice. Already seen your last post from : viewtopic.php?f=202&t=202917

The most generated errors being found on Opencart forum originates from contributed programming. The increased counters are caused by posted redundancies of the same solutions that were already provided prior.

F. Rules:

- viewtopic.php?f=176&t=200480
- viewtopic.php?f=176&t=200804


Regards,
Straightlight


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON
Who is online

Users browsing this forum: No registered users and 5 guests