Per user php.ini with FastCGI

unihostbrasil

Verified User
Joined
Nov 23, 2009
Messages
210
Location
São Paulo - Brazil
There's few documentation from DA about per-user php.ini + FastCGI, maybe it helps somebody.
Here we use two options to personalize PHP settings:

  • /usr/local/directadmin/data/users/[user]/php/[domain].ini
    - These files replace the entire main php.ini (/usr/local/php5[4-5]/lib/php.ini) for the given domain;
    - It needs to be created by the server admin;
    - You can set all PHP directives;

  • .user.ini (PHP scans for these files starting with the directory of the requested PHP file, and working its way up to the current document root)
    - These files don't replace the default php.ini (/usr/local/php5[4-5]/lib/php.ini);
    - It can be created by the user inside their folders;
    - You just can set the PHP_INI_PERDIR and PHP_INI_USER PHP directives, full list here: http://www.php.net/manual/en/ini.list.php

Note that it's also possible to use the additional scanned directory for .ini files: /usr/local/php54/lib/php.conf.d/*
You can create files with per path or domain options [PATH=/home/user/...] and [HOST=domain.com].
More info: http://php.net/ini.sections
 
Back
Top