Hi guys,

In WHM > Easyapache, there is this PHP extension :
Safe PHP CGI - prevents users from overriding system php.ini

my question, can i exclude a user from this, so the user can increase like memory_limit in they account?
if not, is there alternative for this that allowed exclude a user?

Dani AI

Generated

Short answer: you cannot flip the EasyApache “Safe PHP CGI” behavior for a single cPanel account because itʼs an EasyApache/WHM build option (a global change to how PHP is built and how it loads INI files). (support.cpanel.net)
(Also: the system php.ini and the global config paths are admin-controlled — letting users edit the global file is not the correct fix.)

Practical alternatives that let one account increase memory_limit without touching the global php.ini:

  • Let the user edit per-site settings with cPanel’s MultiPHP INI Editor (users or admins can change memory_limit for a specific domain/account). This is the simplest supported method on modern cPanel/EasyApache setups. (support.cpanel.net)

  • Use per-directory user INI files (.user.ini) when the PHP SAPI supports them (CGI/FastCGI / PHP-FPM). Put this in the siteʼs document root:

    memory_limit = 256M

    PHP reads .user.ini files per-directory (PHP 5.3+), with a small cache TTL. (dmelton.net)

  • If you run PHP-FPM, create/adjust that domainʼs FPM pool and set a pool-level value that cannot be overridden by scripts. Example pool snippet:

    php_admin_value[memory_limit] = 256M

    FPM pool settings give admin-level, per-site control. (php.net)

  • On CloudLinux servers, PHP Selector / CageFS gives per-user PHP configuration controls (if available on your host). That is another supported path for per-account INI editing. (cloudlinux-documentation.readthedocs.io)

Quick admin checklist

  1. Identify the PHP handler for the target domain (WHM → MultiPHP Manager or phpinfo()).
  2. If MultiPHP INI Editor is available, change memory_limit there (fast, supported). (support.cpanel.net)
  3. If you prefer isolation and stronger control, enable PHP‑FPM for that domain and set php_admin_value in the pool (restart the pool after changes). (php.net)

Caveats: php_value/php_flag in .htaccess only works with mod_php/DSO; PHPRC/PHPRC-like hacks can break other tools (CloudLinux, selectors) and are discouraged — use the above supported mechanisms instead. (dmelton.net)

(If a precise step-by-step for your server configuration is wanted, post the serverʼs EasyApache/EAversion, PHP handler, and whether CloudLinux is installed and this can be turned into exact commands.)

The file /etc/php.ini should be owned by root, and only root has access to it. If the permissions are not -rw-r----- then it is not correctly configured in the file system. IE, if correctly configured, users should not be able to alter the file and give themselves additional permissions other than what are allowed.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.