> For the complete documentation index, see [llms.txt](https://docs.uxwizz.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.uxwizz.com/guides/environment-settings.md).

# Environment settings

UXWizz can read selected configuration values from server environment variables. This is useful for administrators who want to keep credentials outside application files, or who want to disable specific platform capabilities for security and compliance reasons.

All feature flags are enabled by default. Environment variables are only needed when you want to override the default behavior.

### How UXWizz Reads Environment Variables

UXWizz reads environment variables from PHP using the standard environment sources available on the server:

* `getenv()`
* `$_ENV`
* `$_SERVER`

This makes the feature compatible with common PHP deployments, including Apache, Nginx with PHP-FPM, Docker, Linux services, Windows/WAMP, and other PHP 8+ environments.

Only the exact value `1` enables a disable flag. If a variable is missing, empty, or set to another value, UXWizz keeps the default behavior.

### Setting Environment Variables

The exact method depends on your hosting environment.

#### Linux / Ubuntu

If you have SSH access to an Ubuntu server, the simplest reliable option is to set the variables in the web server or PHP-FPM configuration, then restart the service.

**Apache**

Add these lines inside your Apache virtual host file, usually in `/etc/apache2/sites-available/`

{% hint style="info" %}
If your dashboard is served over HTTPS, this is usually the `*:443` virtual host. On Let's Encrypt setups, that is often the `*-le-ssl.conf` file. If the `*:80` virtual host only redirects to HTTPS, it usually does not need these variables. If UXWizz is also available over plain HTTP, add the same variables to both the `*:80` and `*:443` virtual hosts.
{% endhint %}

```apache
<VirtualHost *:443>
    ...
    SetEnv UXWIZZ_DISABLE_AI_CHAT 1
    SetEnv UXWIZZ_DISABLE_SELFUPDATE 1
    SetEnv UXWIZZ_DISABLE_SCHEDULED_TASKS_EXECUTION 1
    SetEnv UXWIZZ_DB_HOST 127.0.0.1
    SetEnv UXWIZZ_DB_NAME uxwizz
    SetEnv UXWIZZ_DB_USER uxwizz
    SetEnv UXWIZZ_DB_PASSWORD your-secret-password
</VirtualHost>
```

Then restart Apache:

```sh
sudo systemctl restart apache2
```

**PHP-FPM**

If your server uses PHP-FPM, add these lines to your PHP-FPM pool config, for example `/etc/php/8.3/fpm/pool.d/www.conf`:

```ini
env[UXWIZZ_DISABLE_AI_CHAT] = 1
env[UXWIZZ_DISABLE_SELFUPDATE] = 1
env[UXWIZZ_DISABLE_SCHEDULED_TASKS_EXECUTION] = 1
env[UXWIZZ_DB_HOST] = 127.0.0.1
env[UXWIZZ_DB_NAME] = uxwizz
env[UXWIZZ_DB_USER] = uxwizz
env[UXWIZZ_DB_PASSWORD] = your-secret-password
```

Then restart PHP-FPM:

```sh
sudo systemctl restart php8.3-fpm
```

Replace `8.3` with your installed PHP version.

#### Docker

Pass variables to the container:

```sh
docker run \
  -e UXWIZZ_DISABLE_SELFUPDATE=1 \
  -e UXWIZZ_DB_HOST=database \
  -e UXWIZZ_DB_NAME=uxwizz \
  -e UXWIZZ_DB_USER=uxwizz \
  -e UXWIZZ_DB_PASSWORD=your-secret-password \
  your-uxwizz-image
```

#### Windows / WAMP

Set environment variables in Windows, then restart WAMP/Apache so PHP receives the new values.

PowerShell example:

```powershell
[Environment]::SetEnvironmentVariable("UXWIZZ_DISABLE_AI_CHAT", "1", "Machine")
[Environment]::SetEnvironmentVariable("UXWIZZ_DB_HOST", "127.0.0.1", "Machine")
[Environment]::SetEnvironmentVariable("UXWIZZ_DB_NAME", "uxwizz", "Machine")
[Environment]::SetEnvironmentVariable("UXWIZZ_DB_USER", "uxwizz", "Machine")
[Environment]::SetEnvironmentVariable("UXWIZZ_DB_PASSWORD", "your-secret-password", "Machine")
```

### Feature Disable Flags

#### Disable AI Chat

```sh
UXWIZZ_DISABLE_AI_CHAT=1
```

Disables the AI chat question workflow.

When this flag is enabled:

* UXWizz will not send AI chat requests to LLM providers.
* Users can still open the AI chat screen.
* Users can still configure AI provider settings, API keys, model choices, and chat history preferences.
* When a user tries to ask a question, the server rejects the request and shows that AI chat is disabled by the administrator.

Use this when you want a fully local UXWizz installation that cannot send chat prompts to external AI providers.

#### Disable Self-Update

```sh
UXWIZZ_DISABLE_SELFUPDATE=1
```

Disables the built-in automatic updater.

When this flag is enabled:

* UXWizz can still check whether a new version is available.
* UXWizz can still validate the license and support status.
* The update page still shows version information.
* The application will not download, extract, overwrite, or delete files through the self-updater.
* The "Update now" action is disabled in the dashboard.

Use this when updates should be handled by your deployment pipeline, package manager, container image, or manual administrative process.

#### Disable Scheduled Task Execution

```sh
UXWIZZ_DISABLE_SCHEDULED_TASKS_EXECUTION=1
```

Disables execution of scheduled tasks.

When this flag is enabled:

* Admins can still create and edit scheduled task definitions.
* Admins can still view scheduled task history and settings.
* Manual task runs from the dashboard are blocked.
* Automatic task runs from cron or WP-Cron are blocked.
* Existing schedules are preserved, but they will not execute until the flag is removed.

Use this when you want to prevent UXWizz from running maintenance/reporting jobs, while still allowing administrators to review or prepare task configuration.

### Database Credentials From Environment Variables

Standalone UXWizz installations can load the main database connection from environment variables.

Supported variables:

```sh
UXWIZZ_DB_HOST=127.0.0.1
UXWIZZ_DB_NAME=uxwizz
UXWIZZ_DB_USER=uxwizz
UXWIZZ_DB_PASSWORD=your-secret-password
```

UXWizz only uses these variables when the matching value in `server/dbconfig.php` is empty.

For example:

```php
$host = '';
$username = '';
$password = '';
$db_name = '';
```

With the values above empty, UXWizz loads the database connection from:

* `UXWIZZ_DB_HOST`
* `UXWIZZ_DB_USER`
* `UXWIZZ_DB_PASSWORD`
* `UXWIZZ_DB_NAME`

If a value is already hard-coded in `server/dbconfig.php`, the hard-coded value takes priority.

### Updates and Env-Based Database Credentials

When UXWizz updates itself, it preserves database credentials in `server/dbconfig.php`.

If a database value was loaded from an environment variable, UXWizz keeps the matching `dbconfig.php` field empty during the update. This prevents environment-provided secrets from being copied into the application file.

### WordPress Installations

The WordPress version of UXWizz uses the WordPress database configuration constants from `wp-config.php`.

The `UXWIZZ_DB_HOST`, `UXWIZZ_DB_NAME`, `UXWIZZ_DB_USER`, and `UXWIZZ_DB_PASSWORD` variables are only used by standalone UXWizz installations, not by the WordPress overwrite package.

### Security Notes

* Do not expose environment variables in public PHP info pages, debug output, logs, or screenshots.
* Prefer environment variables or secret managers for production database credentials.
* Restart the web server or PHP process after changing environment variables.
* Feature disable flags are enforced server-side. Dashboard UI messages are informational, but the security boundary is the backend guard.
* Environment variables should be set by the server administrator, deployment system, hosting panel, or container runtime.

### Reference

| Variable                                   | Default | Description                                                                                      |
| ------------------------------------------ | ------- | ------------------------------------------------------------------------------------------------ |
| `UXWIZZ_DISABLE_AI_CHAT`                   | unset   | Set to `1` to prevent AI chat requests from being sent to LLM providers.                         |
| `UXWIZZ_DISABLE_SELFUPDATE`                | unset   | Set to `1` to disable the built-in file updater.                                                 |
| `UXWIZZ_DISABLE_SCHEDULED_TASKS_EXECUTION` | unset   | Set to `1` to block manual and automatic scheduled task execution.                               |
| `UXWIZZ_DB_HOST`                           | unset   | Main database host, used only when `$host` is empty in standalone `server/dbconfig.php`.         |
| `UXWIZZ_DB_NAME`                           | unset   | Main database name, used only when `$db_name` is empty in standalone `server/dbconfig.php`.      |
| `UXWIZZ_DB_USER`                           | unset   | Main database username, used only when `$username` is empty in standalone `server/dbconfig.php`. |
| `UXWIZZ_DB_PASSWORD`                       | unset   | Main database password, used only when `$password` is empty in standalone `server/dbconfig.php`. |


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.uxwizz.com/guides/environment-settings.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
