Increase PHP Allowed Memory Limit

austinkettner
PRO

2 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?

$10 Bounty

3 Replies

2 months ago

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


austinkettner
PRO

2 months ago

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


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.


Increase PHP Allowed Memory Limit - Railway Help Station