Override default PHP memory_limit not working

Freddy

Verified User
Joined
Apr 14, 2016
Messages
119
What I do is go to the domain settings and then click the "PHP settings" button.

1625478618844.png

I then change memory_limit from 128M to 256M and click "Save". After that the page shows me the red outlined part that the memory limit has been overriden.

1625478743607.png

Now I expect the memory limit from phpinfo() says 256M instead of 128M, but it still says 128M. I restarted PHP-FPM but the value didn't change.

1625478984504.png

What am I doing wrong here? Are these domain PHP settings not working?
 
Hello. Maybe you are using htscanner and in the file .htaccess there is a directive that overrides the value? Also check that there are no parameters specified for the domain in Custom HTTPD Configurations.
 
Hello. Maybe you are using htscanner and in the file .htaccess there is a directive that overrides the value? Also check that there are no parameters specified for the domain in Custom HTTPD Configurations.
None of that all. There are no custom changes that override any PHP setting. Not in .htaccess and not in the custom HTTPD configurations.

Which brings me to the point, where should the custom PHP settings be applied? Can I check a file somewhere to see if the configuration has adapted to my settings?
 
you might need to set it on the default domain, when using php-fpm

mod_php does have the option to make it work per-domain, but sadly, php-fpm is per-user (and set with the default domain).
 
@Freddy
maybe
PHP-FPM will apply setting to "/usr/local/directadmin/data/users/{USERNAME}/php/php_fpmXX.conf"

and mod_php will apply to "httpd.conf" from above path
 
you might need to set it on the default domain, when using php-fpm

mod_php does have the option to make it work per-domain, but sadly, php-fpm is per-user (and set with the default domain).
This fixed it! It was indeed the default domain that required the change.
 
@Freddy
maybe
PHP-FPM will apply setting to "/usr/local/directadmin/data/users/{USERNAME}/php/php_fpmXX.conf"

and mod_php will apply to "httpd.conf" from above path
This was also helpful. I found the php_fpmXX.conf file and it now reflects my settings.
 
I think lsphp also has it per domain, but if you're using lsphp you're either using CloudLinux (which has another selector for those settings) or Litespeed (which is crazy expencive XD)
 
I think lsphp also has it per domain, but if you're using lsphp you're either using CloudLinux (which has another selector for those settings) or Litespeed (which is crazy expencive XD)
I don't really need it per domain. I just need it to work. ;)
But maybe DirectAdmin could have warned me for this when I editted the settings for a non-default domain.
 
Back
Top