Jump to content
Brian Scramlin

Site Crashed from Set Locale

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.

Share this post

Link to post
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

Share this post

Link to post
Share on other sites
2 hours ago, kixe said:

This cannot cause such a problem.


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

Share this post

Link to post
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:


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

Might be something in the discussion that helps:


  • Like 1

Share this post

Link to post
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

Share this post

Link to post
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

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Pip
      Hi Everyone 
      I've been working on Processwire for two months now. Structuring the website as needed. Unsure why but I'm getting this one now. Seems my fields has crashed. 
      I've tried googling some answers but can't seem to find a step by step guide on how to rectify this. Any advise? Practically new on this. 

    • By benbyf
      I always seem to get this warning on every new install of PW on my Ubuntu 14 box with Digital Ocean. The servers are usually based in the UK and I was wondering if I should be adding something other than the below in the config? Is there a UK based locale code? Quick Google didnt come up with much.
      Warning: your server locale is undefined and may cause issues. Please add this to /site/config.php file (adjust “en_US.UTF-8” as needed): setlocale(LC_ALL,'en_US.UTF-8');
      Added to the config file:
    • By Francesco Bortolussi
      Hi to everyone, please try to consider this post as a possible thread to every PW installation.
      We have used PW to backend  a website and app for a big big company, so stability must be granted.
      Recently  we was into a big trouble, filesystem was blocked because no Inodes left. The assets/files/ folder was full with more than 7 million directories.
      After some research we found a possible origin to this:
      If we have a template user, which have assigned a repeater field. And then we set as parent of that repeater a "User" page,  this could lead into an infinite loop of pages creation; because the template_id for the repeater pages was set to "User Template" and since "User Template" includes that repeater it will need to create another page and you go on until your disk crash.
      Usually repeaters should stay under Admin->Repeaters.
      And here is the main questions:
      Can a repeater page be created with the same template_id as his "container" page?
      At database(Mysql) level does the template_id field will be filled with his parent template_id in the pages table when you import the repeater field?
      (Sorry for that but filed means something for db schema too)

      Could someone  tell me if this actually happen. If so, could this be checked in a future release to prevent this problems?
      You should say, "How could this happen?" 
      This happen when you have different environments and you migrate fields from one to another environment; a Page ID that is an Admin->Repeaters child page in one environment is not necessarily the same in another.
      Thank you for your time reading.
    • By lenoir
      I've created an Options field and it keeps crashing by saving. I get the following message: "Forbidden. You don't have permission to access /admin/setup/field/save on this server." I activated the debug mode in the config file, but I don't see any error message.
      The options are from 1 to 20, with a standard value of 20. It's a "select (single value)". Nothing fancy otherwise.
      Has anyone encountered this before? 
    • By Jennifer S
      Good morning. I'm having a problem with my big PW site. It stopped responding less than an hour ago (except for the 500 Internal Error message). Here is what the error log says:
      2014-03-17 13:07:50    ?    https://wwwudev.cac.washington.edu/?/    Error:     Exception: SQLSTATE[HY000]: General error: 1194 Table 'modules' is marked as crashed and should be repaired (in /nfs/bronfs/uwfs/info/wwwudev/world/uaa/advising/wire/core/Modules.php line 251) 2014-03-17 13:13:30    ?    https://wwwudev.cac.washington.edu/?/    Error:     Exception: SQLSTATE[HY000]: General error: 1194 Table 'fields' is marked as crashed and should be repaired (in /nfs/bronfs/uwfs/info/wwwudev/world/uaa/advising/wire/core/WireSaveableItems.php line 141) 2014-03-17 13:19:02    ?    https://wwwudev.cac.washington.edu/?/    Error:     Call to a member function has() on a non-object (line 36 of /nfs/bronfs/uwfs/info/wwwudev/world/uaa/advising/wire/core/Users.php)   I repaired the modules and fields table but now I'm getting the last error and I don't know what is happening. The site is on a shared server; I checked to make sure I have lots of disk space. I don't know what could have changed this morning; my next step is to ask our network technicians.
  • Create New...