# A site fails with "Invalid command 'php_value'"

UrbeStack sysadmin note about Apache. Last updated 30 Nov 2026.

A site returns `500 Internal Server Error` because its `.htaccess` contains a `php_value` or `php_flag` line. Apache does not recognize these directives here because PHP runs through PHP-FPM, so move the values to the domain's PHP settings.

## Symptoms

Every page of the site returns `500 Internal Server Error`. Read the domain's error log with the following command.

```
urbestack-domain-log --name example.com --type error
```

```output
[Mon Nov 30 08:12:29.273001 2026] [core:alert] [pid 1377:tid 1417] [client 203.0.113.10:40618] /home/USER/files/web/example.com/public_html/.htaccess: Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration
```

## Cause

UrbeStack runs each site's PHP in its own PHP-FPM pool. Apache passes PHP requests to that pool.

`php_value` and `php_flag` are directives from `mod_php`, the PHP module for Apache. These servers do not load that module. Apache rejects the entire `.htaccess` file, so every page fails.

## Resolution

Delete the `php_value` and `php_flag` lines from `.htaccess`. The site responds again immediately.

Set the values in the domain's PHP settings. This example sets `memory_limit`.

```
urbestack-domain-set --name example.com --php-setting memory_limit=512M
```

The command accepts `memory_limit`, `upload_max_filesize`, `post_max_size`, `max_execution_time`, `max_input_vars`, `disable_functions`, `display_errors` and `date.timezone`.

You can also set `display_errors` and `date.timezone` in a `.user.ini` file in the site's folder.

If the problem persists after you follow this note, you can [open a support ticket](https://support.urbestack.com/new?type=support). Including the output of the commands you ran helps support diagnose the problem.
