Increase PHP Allowed Memory Limit
austinkettner
PROOP

a year 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

a year 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

a year ago

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


austinkettner
PROOP

a year ago

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


a year 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 7 months ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...