# A site runs out of memory

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

A page fails with `Allowed memory size of 268435456 bytes exhausted`. You can raise the site's `memory_limit` only in the domain's PHP settings.

## Symptoms

The page returns `500 Internal Server Error` or stops partway through. Check the domain's PHP log.

```
urbestack-domain-log --name example.com --type php
```
```output
[30-Nov-2026 08:12:29 UTC] PHP Fatal error:  Allowed memory size of 268435456 bytes exhausted (tried to allocate 314576896 bytes) in /home/USER/files/web/example.com/public_html/mem.php on line 1
```

The limit of `268435456` bytes is 256 MB, UrbeStack's default `memory_limit` for sites.

## Cause

The script needed more memory than `memory_limit` allows.

UrbeStack sets `memory_limit` with `php_admin_value` in the domain's PHP-FPM pool. This locks the value for the site. Calls to `ini_set('memory_limit', ...)` fail and return `false`. PHP ignores the setting in `.user.ini`.

## Resolution

Raise the domain's limit to 512 MB.

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

Load the page again and check the PHP log.

To change the default for every domain without a value of its own, set the limit on the Limits tab of the PHP page in the web interface.

Each PHP process for the site can use up to this much memory, and the pool runs several processes at once. Take the server's available memory into account when setting the limit.

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.
