Increase PHP Allowed Memory Limit
austinkettner
PROOP

9 months ago

We have a Wordpress application hosted and it's running into some memory limit issues. I am curious how we would set the memory limit to be higher?

```[04-Jun-2025 14:25:51 UTC] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 41500672 bytes) in /var/www/html/wp-includes/comment-template.php on line 2423```

Does Railway support any env vars to control this and up the limit? Such as WP_MEMORY_LIMIT?

Solved$10 Bounty

Pinned Solution

9 months ago

I believe the proper variable would be PHP_MEMORY_LIMIT. You can specify this to whatever amount you'd like, using the conventional letters. For example. 1024M would be 1024 megabytes.

3 Replies

9 months ago

Yes, it does. It works normally like any other env var.


austinkettner
PROOP

9 months ago

I'm curious if this is the proper env var? What would be the expected value in bytes or mb?


9 months ago

I believe the proper variable would be PHP_MEMORY_LIMIT. You can specify this to whatever amount you'd like, using the conventional letters. For example. 1024M would be 1024 megabytes.


Status changed to Solved noahd 5 months ago


Loading...