php memory_limit for a specific user cli

stefantriep

Verified User
Joined
Dec 15, 2012
Messages
70
Location
Haarlem, The Netherlands
I've already done at Custom HTTPD Configurations ->user.com ->php-fpm.conf

At the php-fpm Global |CUSTOM2| tab:
php_admin_value[memory_limit] = 1024M

At the php-fpm php-fpm |CUSTOM2| tab:
php_admin_value[memory_limit] = 1024M

But this only sets 1024 MB for the php-fpm web through apache, not for the php cli, which still gives:
php -i | grep memory_limit
memory_limit => 512M =>512M

Added php_value[memory_limit] = 1024M with no change
Added memory_limit = 1024M with an error and stopped php-fpm, reverted to previous to make it work again

Restarted php-fpm and SSH serveral times, but no effect.

Any other wizard that has the hint to accomplish this?
 
CLI - common, maybe you can put htaccess with memory limit to user's root-dir and chattr it.
 
Depends on what you are using. Try either in a .htaccess file or a .user.ini file in the users public_html directory (root dir).
 
put additional htaccess owned by root in upper dir, check is it has more priority (also user can't modify it)
 
The command-line PHP is not going to read any webserver specific configuration settings to set PHP directives.

Just modify the directive directly on the command line:

Code:
php -d memory_limit=512M /path/to/php/script/to/run.php
 
Back
Top