KamranMK Posted December 10, 2012 Share Posted December 10, 2012 Hi All, I am really in a bad situation. My prestashop is not working, it constantly shows this error please someone help me Fatal error: Uncaught Link to database cannot be established: SQLSTATE[HY000] [2005] Unknown MySQL server host '_DB_SERVER_' (0) thrown in /home8/shoperaa/public_html/classes/db/DbPDO.php on line 109, this is getting ridiculuos , i don't even understand why this issue occurs? Link to comment Share on other sites More sharing options...
Alex Simonchik BelVG Posted December 10, 2012 Share Posted December 10, 2012 Hi, I guess that you are have wrond DB-connection. Check your DB-connections data in config/settings.inc.php Regards 1 Link to comment Share on other sites More sharing options...
KamranMK Posted December 10, 2012 Author Share Posted December 10, 2012 Very interesting but my settings.inc.php is empty how did this happen? very very strange Link to comment Share on other sites More sharing options...
KamranMK Posted December 10, 2012 Author Share Posted December 10, 2012 where can i find a backup or similar file, how can this be rebuilt, it is empty Link to comment Share on other sites More sharing options...
Alex Simonchik BelVG Posted December 10, 2012 Share Posted December 10, 2012 (edited) For example: define('_DB_SERVER_', 'localhost'); define('_DB_NAME_', ''); define('_DB_USER_', ''); define('_DB_PASSWD_', ''); define('_DB_PREFIX_', 'ps_'); define('_MYSQL_ENGINE_', 'InnoDB'); define('_PS_CACHING_SYSTEM_', 'CacheMemcache'); define('_PS_CACHE_ENABLED_', '0'); define('_MEDIA_SERVER_1_', ''); define('_MEDIA_SERVER_2_', ''); define('_MEDIA_SERVER_3_', ''); define('_COOKIE_KEY_', 'ELgkrJs295iK0QHuFjxpyB555WaybRrh7VvAgStpxDjoVwsgs8XZKz4q'); define('_COOKIE_IV_', 'NdaUfx3J'); define('_PS_CREATION_DATE_', '2012-12-09'); define('_PS_VERSION_', '1.5.2.0'); define('_RIJNDAEL_KEY_', 'tyBq30iNd1eGomULuCxFhYp55uHEIG7Z'); define('_RIJNDAEL_IV_', 'Qu55y5SXo4P4cOlT2WcqTw=='); Edited December 10, 2012 by Alexander Simonchik (see edit history) Link to comment Share on other sites More sharing options...
KamranMK Posted December 10, 2012 Author Share Posted December 10, 2012 does this mean, that all my information is gone? Link to comment Share on other sites More sharing options...
Alex Simonchik BelVG Posted December 10, 2012 Share Posted December 10, 2012 At least it means that somebody delete all data in config/settings.inc.php. But your information saved in DB, check it there Link to comment Share on other sites More sharing options...
KamranMK Posted December 10, 2012 Author Share Posted December 10, 2012 the information is saved but can this someone be a module or a script, or can it be someone from other side or from other computer accessed, i mean can i call this a hack? Link to comment Share on other sites More sharing options...
Alex Simonchik BelVG Posted December 10, 2012 Share Posted December 10, 2012 Yes, it can be all of this. Check your custom modules, change DB and FTP access. Link to comment Share on other sites More sharing options...
KamranMK Posted December 10, 2012 Author Share Posted December 10, 2012 how can i check it, i mean from where, last time it went like this was because of the mobile template for 1.4 which should be compatible with 1.5.2? how can I check it? Link to comment Share on other sites More sharing options...
Dh42 Posted December 10, 2012 Share Posted December 10, 2012 Hmm how many users do you have to your current site? Replacing the file with the one posted is going to change all of the passwords too. 1 Link to comment Share on other sites More sharing options...
KamranMK Posted December 10, 2012 Author Share Posted December 10, 2012 the site is still in the development so i don't have any users whatsoever, what else do i lose can you please tell me? Link to comment Share on other sites More sharing options...
Dh42 Posted December 10, 2012 Share Posted December 10, 2012 Nothing, the passwords are just set around the cookie key. If you don't have any users then it is not a big deal. Although I would try to figure out how the file got deleted. Link to comment Share on other sites More sharing options...
KamranMK Posted December 10, 2012 Author Share Posted December 10, 2012 Sounds great, i was really worried, i would love to find out why this happened but my prestashop skills are not sufficient, do you think you can help me? Link to comment Share on other sites More sharing options...
Dh42 Posted December 10, 2012 Share Posted December 10, 2012 Your best bet is asking your host. See if they have logs of when the file was deleted and by what ip address it was deleted. Link to comment Share on other sites More sharing options...
KamranMK Posted December 10, 2012 Author Share Posted December 10, 2012 I have done that, but interestingly enough, it was not deleted it was modified and emptied, thus the log doesnt show the change, this happened right after the mobile template installation, how do you think i can find out what has happened? Link to comment Share on other sites More sharing options...
KamranMK Posted December 10, 2012 Author Share Posted December 10, 2012 everything is great, i managed to fix this, thanks to all of you guys, but now i can't log into the backend, do you know how can i fix this Link to comment Share on other sites More sharing options...
Dh42 Posted December 10, 2012 Share Posted December 10, 2012 You will have to reset your password since your cookie key has changed. 1 Link to comment Share on other sites More sharing options...
KamranMK Posted December 10, 2012 Author Share Posted December 10, 2012 thanks a lot Link to comment Share on other sites More sharing options...
benjamin utterback Posted December 10, 2012 Share Posted December 10, 2012 Hello KamranMK, how were you able to fix this? Did you ever get information on why or when these settings were emptied? Link to comment Share on other sites More sharing options...
KamranMK Posted December 10, 2012 Author Share Posted December 10, 2012 I was able to fix just by replacing the files, but unfortunately i was not able to understand why they were emptied, i feel it is either something related to the mobile template since it happened right after i installed it, enabled and then disabled it but then i sort of think the www. issue which i still have may have an effect on it, my shop still has the domain.az not www.domain.az name, i tried to use the fix which came out it started throwing many different small issues so i decide to go on the safe side Link to comment Share on other sites More sharing options...
benjamin utterback Posted December 10, 2012 Share Posted December 10, 2012 Hello KamranMK, thank you for the feedback. It is through information like this that we continue to make PrestaShop better each day. I will go ahead and mark this thread as SOLVED, thank you for choosing PrestaShop! Best Regards, Benjamin Link to comment Share on other sites More sharing options...
KamranMK Posted December 10, 2012 Author Share Posted December 10, 2012 Hi Benjamin, Thank you too for such a great system, i really look forward to help to advance to the next level Link to comment Share on other sites More sharing options...
KamranMK Posted December 11, 2012 Author Share Posted December 11, 2012 Attention! Attention everyone, I don't understand why, but the file got emptied again today, this is very strange, i replaced the file this time again but I have a feeling that this is going to continue, can somebody help me to track the issue, or how can i do that? Hello KamranMK, thank you for the feedback. It is through information like this that we continue to make PrestaShop better each day. I will go ahead and mark this thread as SOLVED, thank you for choosing PrestaShop! Best Regards, Benjamin I guess you will have to undo the SOLVED, since this issue occured today again Link to comment Share on other sites More sharing options...
Alex Simonchik BelVG Posted December 11, 2012 Share Posted December 11, 2012 KamranMK, I guess that you have some module, that working with issue, but nobody can't detect it without access to your FTP. Try disable all custom modules and custom mobile theme. Also check overrides on your system. Regards Link to comment Share on other sites More sharing options...
KamranMK Posted December 11, 2012 Author Share Posted December 11, 2012 Hi Alexander, thanks for replying, for now I have changed the permissions to the file from 644 to 444 and the issue sort of stopped, which means i don't experience it right now but everything can happen, that's what i think as well, i have disabled the mobile theme for now, when you mean check overrides, what exactly should i check? Link to comment Share on other sites More sharing options...
Alex Simonchik BelVG Posted December 11, 2012 Share Posted December 11, 2012 For changing overrides you can go to Backend->Advanced Parameters->Configuration Information-> And view the list of changed files. Note the files in the override folder. Regards Link to comment Share on other sites More sharing options...
KamranMK Posted December 11, 2012 Author Share Posted December 11, 2012 Here is the list of my changed files, maybe you can find out why this has happened footer.php header.php classes/AddressFormat.php classes/Cart.php classes/Link.php classes/db/DbPDO.php classes/shop/Shop.php config/config.inc.php config/defines.inc.php config/smarty.config.inc.php config/xml/modules_list.xml js/jquery/plugins/autocomplete/jquery.autocomplete.css js/jquery/plugins/fancybox/jquery.fancybox.css js/jquery/plugins/jqzoom/jquery.jqzoom.css js/jquery/plugins/jqzoom/jquery.jqzoom.js modules/blockbestsellers/blockbestsellers-home.tpl modules/blockbestsellers/blockbestsellers.tpl modules/productcomments/productcomments-extra.tpl modules/productcomments/productcomments.css modules/productcomments/img/star.gif override/classes/shop/Shop.php override/controllers/admin/AdminProductsController.php Link to comment Share on other sites More sharing options...
Trip Posted April 30, 2013 Share Posted April 30, 2013 (edited) Hi there, I had a lot of test installations and this happened to me a couple of times too. Usually after upgrades. I never had an idea why this could happen and did not read much about that in the forum. Today I made another shop upgrade and after I loaded the modules page to reinstall the paypal module the settings.inc.php was emptied again. Is there any chance that that the paypal module is the suspect? My vague guess is, that it might related to the paypal module or/and the mobile theme enabling/disabling. Maybe the reports of "crashed paged" are related to that. I know that I had that a lot of times during playing around after test upgrades with the 1.5.x branch. Now usually I have a copy of settings.inc.php but the bug is reproducable although I am not sure when exactly it is triggered. All the best, trip Edited April 30, 2013 by Trip (see edit history) Link to comment Share on other sites More sharing options...
breda_Mcg Posted April 18, 2014 Share Posted April 18, 2014 Same problem happening to me with prestashop 1.5, can't identify what is causing it. Did anyone find a solution? B Link to comment Share on other sites More sharing options...
Trip Posted April 18, 2014 Share Posted April 18, 2014 Had no problems with the latest 1.5x versions. Before that I changed file permission so web user had not write permissions on the file but before upgrades you should change that back as there might be changes to the file. Regards, Trip Link to comment Share on other sites More sharing options...
breda_Mcg Posted April 21, 2014 Share Posted April 21, 2014 thanks I'll try that. B Link to comment Share on other sites More sharing options...
Recommended Posts