Jump to content

Site Crashed from Set Locale


Brian Scramlin
 Share

Recommended Posts

Hey everyone,

I had one of the worst days of my life today due to the setlocale(LC_ALL,'en_US.UTF-8'); suggestion at the notification bar of my admin panel.

I went into config.php, went to the last line and added setlocale(LC_ALL,'en_US.UTF-8');

Then my client's 30k/day site completely crashed. All I can get is the following output:

404 page not found (no site configuration or install.php available)

Of course I removed the line of code and the problem is still there. 

In the midst of all of that I did NOT have the site profile exported, nor did I have a backup of the files and when I panicked I tried to upgrade the Processwire components, but in the fray of it all I recursively removed the assets folder--losing about 3-4GB of images and files. The client pays to get access to many of these photos, most of which are mug shots for newly released criminals and they do not have a local backup. 

So, I thankfully had a copy of all my templates, remade every one of my fields, and at least tried to get them publishing fresh again. Well, that same error showed up at the top of the screen. Guess what I did? 

The SAME THING!!! Only now I am BEGGING for help. I cannot start over again. Please, someone offer any advice.

I thought I did EXACTLY what I was instructed to do.

Link to comment
Share on other sites

I cannot reproduce. No probleme to run setlocale() from config.php. This cannot cause such a problem.

  1. Did you use the same database for your fresh install? Or is the database still there? In case of complete crash access directly to the database via phpMyAdmin, adminer or any other mysql administration tool and export the database first as .sql or zipped sql file to have a backup. Do you have a tool like this in use? You can make also regularly backups of your database via cronjob: http://modules.processwire.com/modules/cronjob-database-backup/
  2. File permissions checked?
  3. Really no backup of the uploaded files?
  • Like 2
Link to comment
Share on other sites

2 hours ago, kixe said:

This cannot cause such a problem.

+1

Something else must have happened too "about at the same time". Setlocale is used so that the system can handle certain utf-8 characters properly when uploading files. What sort of characters does your client use when naming files to be uploaded? Maybe you set it to en_US.UTF-8 and soon after they uploaded something not supported in this character set? I think it is quite unlikely to be the issue. You might want to figure out what else could have happened.

Edited by szabesz
added: ...when uploading files...
  • Like 1
Link to comment
Share on other sites

3 hours ago, Brian Scramlin said:

404 page not found (no site configuration or install.php available)

In another thread Ryan said:

Quote

That error occurs only if $config->dbName is undefined (from /site/config.php).

Might be something in the discussion that helps:

 

  • Like 1
Link to comment
Share on other sites

I am reading through replies, but wanted everyone to know as of one hour ago, I was able to reload backup from a couple of days ago. Thankfully my server configuration was set up to do this automatically. I'm new to this journey, and I will always be more careful. In fact, I am finally convinced I should have the following workflow: virtualized local configuration matching server config > commit to git local > push git to cloud > upload changes to live site.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...