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_IMAGE', str_replace('\\', '/', realpath(dirname(__FILE__) . '/../')) . '/image/');
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

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


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?

Code: Select all

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
Last edited by straightlight on Mon Feb 24, 2020 7:43 pm, edited 1 time in total.
Reason: Added code tags.

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

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

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

Post by Majnoon » Thu Feb 24, 2022 9:18 am

straightlight wrote:
Fri Oct 20, 2017 10:06 am

Then, once all the path captured
Where these path will show. Which file?

Active Member

Posts

Joined
Fri Feb 05, 2021 8:29 pm

Post by straightlight » Fri Feb 25, 2022 1:07 am

Majnoon wrote:
Thu Feb 24, 2022 9:18 am
straightlight wrote:
Fri Oct 20, 2017 10:06 am

Then, once all the path captured
Where these path will show. Which file?
OC version. New topic.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

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

Post by Majnoon » Sat Feb 26, 2022 11:34 am

straightlight wrote:
Fri Feb 25, 2022 1:07 am
Majnoon wrote:
Thu Feb 24, 2022 9:18 am
straightlight wrote:
Fri Oct 20, 2017 10:06 am

Then, once all the path captured
Where these path will show. Which file?
OC version. New topic.
You may delete this comments i already figure out the issue was with path in config file.
Thanks

Active Member

Posts

Joined
Fri Feb 05, 2021 8:29 pm
Who is online

Users browsing this forum: No registered users and 134 guests