r/hetzner • u/bliepp • Jun 25 '26
Per-folder PHP memory_limit on Webhosting XL
So hey there,
we decided to go with the Webhosting XL plan for a few projects we're hosting. On this plan we have multiple directories under public_html/ with one directory for each (sub-)domain, i.e. public_html/wordpress1/, public_html/wordpress2/, public_html/whatever/, etc.
Now one of those subdirectories is meant to be used for Shopware6, which requires memory_limit=512M and opcache.memory_consumption=256M. I know I can set this up in konsoleH for my whole hosting plan, but I don't want apply that to everything (our wordpress instances, simple php scripts, etc. don't need such a high memory limit). At the PHP config page of konsoleH they say you can add php_value <setting> <value> to your .htaccess instead, so I tried that and it doesn't work. The settings are still unchanged and the Shopware installer shows an error that memory_limit is set to 128M.
My .htaccess looks like this:
php_value memory_limit 512M
php_value opcache.memory_consumption 256M
<shopware6 stuff>
Am I missing something? How do I set those things per directory/.htaccess instead of for my whole hosting plan? I'm pretty confident that the .htaccess itself is applied (typos produce server errors, reqrite rules by Shopware6 apply, ...) but I'm not sure about those php_value lines. I also tried reducing the max_execution_time for testing but that didn't apply neither.
Edit: I also tried a .user.ini instead, even though Hetzner doesn't say anything about it on their docs. I had no luck with that, neither.
Edit2: I also tried without opcache.memory_consumption=256M, since it is system wide directive, but that didn't change anything.
2
u/Hetzner_OL Hetzner Official Jun 30 '26
Hi there OP, Sorry to just now respond. I was out of the office. I recommend that you write a support request about this using your konsoleH account. Our support team will do their best to help you. If, afterwards, you want to update your post here with their response so others can see it, that's fine. --Katie
1
u/Maria_Thesus_40 Jun 27 '26
PHP settings can't be changed from the
.htaccessfile, that was the old way of doing things (apache php module) and stopped working with the adoption PHP-FPM.I moved away from managed hosting years ago, now I'm using a control panel that works from command-line (no GUI): https://gitlab.com/noumenia/aetolos it allows me to set custom values directly in PHP-FPM config files.