[Nix-dev] Custom php.ini for cli calls

4levels 4levels at gmail.com
Thu Feb 4 15:52:10 CET 2016


Hi Nix Devs,

I'm trying to increase the memory_limit settings for php cli calls.
For the phpfpm calls I've managed (a few months ago) to append my custom
options to the php.ini file as the phpfpm service has an option to do so.
However, for php cli calls, the memory_limit value is usually set to
unlimited, but not with the default config in the nix package: it has a
value of 128M (instead of the expected -1).

In the php/default.nix I can see that the ini file is generated in the
installPhase, but I'm failing to override this.

Do you have any suggestions on how to achieve this?


Kind regards,

Erik

Working phpfpm custom ini snippet:

# Custom PHP ini file for apc / memcached
services.phpfpm.phpIni = pkgs.runCommand "php.ini" {
  options = ''
    date.timezone = Europe/Brussels
    extension = "${pkgs.phpPackages.apcu}/lib/php/extensions/apcu.so"
    max_execution_time = 30
    post_max_size = 100M
    upload_max_size = 100M
    upload_max_filesize = 20M
    memory_limit = 256M
    apc.enable = 1
  '';
}
''
  cat ${pkgs.php}/etc/php-recommended.ini > $out
  echo "$options" >> $out
'';
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.science.uu.nl/pipermail/nix-dev/attachments/20160204/66e502a2/attachment.html 


More information about the nix-dev mailing list