site.php file half erased - how to reconstruct?

Permalink
My 5.6.3.3 site suddenly went blank with a 500 error. I looked at the error log and it said PHP Fatal error: Call to a member function query() on boolean in /public_html/site/concrete/core/models/package.php on line 66

I looked in Config/site.php and half the file has been erased. The last complete line starts with: define('DB_DATABASE',

So the rest of the lines including define('PASSWORD_SALT', are missing.

How do I rebuild this file?

 
ConcreteOwl replied on at Permalink Best Answer Reply
ConcreteOwl
You only need the first four lines for the site to load
<?php
define('DB_SERVER', 'localhost');
define('DB_USERNAME', 'xxxx');
define('DB_PASSWORD', 'xxxxxxxxxxxxxx');
define('DB_DATABASE', 'xxxxxxxxx');

Ensure each line ends with a ';' and there are no empty lines.
The other lines are enhancements and customization code.
If those lines are complete, it is probably the web server that is not delivering the database for whatever reason (server crash)
If the server has crashed and corrupted your files, tell the tech guys to restore your site from a server backup.
rusty007 replied on at Permalink Reply
Thanks for that. I realised this after poking around but it didn't work until I found I had used an IP address for the SQL server instead of localhost. It seems my host had changed something in that setup. Its all working again now.
mnakalay replied on at Permalink Reply
mnakalay
weyboat is right, those 4 lines are the only ones required to load the site.

But if you've lost your salt you're going to have problems with your users' passwords