> For the complete documentation index, see [llms.txt](https://docs.apryse.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.apryse.com/core/get-started/faq/error-env-locale-configuration.md).

# Why am I seeing "An error was detected with your environment's locale configuration"?

World's #1 PDF SDK Library for Web, Mobile, Server, Desktop

This error can occur on POSIX (Mac or Linux) systems when the configured locale is not actually available. This is known to happen by default on certain **AWS Lambda** runtimes.

## How can I fix this quickly?

Just set the `LC_ALL` environment variable to `"C"`. You can do this at the command line before running your program, from within your program, or if running on [AWS Lambda, from the configuration panel](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html).

{% tabs %}
{% tab title="Bash" %}
{% code lineNumbers="true" %}

```bash
export LC_ALL=C
```

{% endcode %}
{% endtab %}

{% tab title="JavaScript" %}
{% code lineNumbers="true" %}

```js
process.env.LC_ALL = 'C';
```

{% endcode %}
{% endtab %}

{% tab title="Python" %}
{% code lineNumbers="true" %}

```python
import os

# ...

os.environ['LC_ALL'] = 'C'
```

{% endcode %}
{% endtab %}

{% tab title="Go" %}
{% code lineNumbers="true" %}

```go
import ("os")

// ...

os.Setenv("LC_ALL", "C")
```

{% endcode %}
{% endtab %}

{% tab title="Java" %}
{% code lineNumbers="true" %}

```java
System.setProperty("LC_ALL", "C");
```

{% endcode %}
{% endtab %}

{% tab title="C++" %}
{% code lineNumbers="true" %}

```cpp
#include <stdlib.h>

// ...
// POSIX only
setenv("LC_ALL", "C", 1 /*overwite existing value*/);
```

{% endcode %}
{% endtab %}

{% tab title="C#" %}
{% code lineNumbers="true" %}

```csharp
using System;

// ... 

Environment.SetEnvironmentVariable("LC_ALL", "C");
```

{% endcode %}
{% endtab %}

{% tab title="PHP" %}
{% code lineNumbers="true" %}

```php
putenv("LC_ALL=C");
```

{% endcode %}
{% endtab %}

{% tab title="VB" %}
{% code lineNumbers="true" %}

```vb
Environment.SetEnvironmentVariable("LC_ALL", "C")
```

{% endcode %}
{% endtab %}
{% endtabs %}

If you are setting this from within your program, make sure you do so **before** you make any calls to the Apryse SDK.

## Why does this happen?

This error occurs when one of the environment variables used to request a locale is set to a locale that is not present on the system. These variables are as follows:

* `LC_ALL`
* `LC_COLLATE`
* `LC_CTYPE`
* `LC_MESSAGES`
* `LC_MONETARY`
* `LC_NUMERIC`
* `LC_TIME`
* `LANG`

`LC_ALL` has the highest priority, so if it is set, it is used. `LANG` is used as a fallback, only if the other values are not set. You can search for the values of these, if set, using the following command:

{% tabs %}
{% tab title="Bash" %}
{% code lineNumbers="true" %}

```bash
env | grep -E 'LC_.*=|LANG.*='
```

{% endcode %}
{% endtab %}
{% endtabs %}

You can compare the values specified for each variable to the list of available locales:

{% tabs %}
{% tab title="Bash" %}
{% code lineNumbers="true" %}

```bash
locale -a
```

{% endcode %}
{% endtab %}
{% endtabs %}

If one of the required locales is not available, you should either set the environment variable to an available locale (as shown above), or if required, generate the locale (out of scope for this FAQ).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.apryse.com/core/get-started/faq/error-env-locale-configuration.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
