Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

php package does not consider anymore /etc/php.d/xxx.ini #89011

Closed
shyim opened this issue May 27, 2020 · 11 comments
Closed

php package does not consider anymore /etc/php.d/xxx.ini #89011

shyim opened this issue May 27, 2020 · 11 comments

Comments

@shyim
Copy link
Member

shyim commented May 27, 2020

Describe the bug
PHP does not consider anymore ini files under /etc/php.d/

To Reproduce

environment.etc."php.d/shyim.ini" = {
    text = ''
      memory_limit=2G
          '';

    mode = "0777";
  };

php -i | grep memory_limit is still 128MB.
This did worked in previous channel

Expected behavior
I can override the default values

Screenshots

Additional context

Notify maintainers
@etu

Metadata

  • system: "x86_64-linux"
  • host os: Linux 5.6.13, NixOS, 20.09pre226148.0f5ce2fac0c (Nightingale)
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.3.4
  • channels(shyim): "nixos-20.09pre226148.0f5ce2fac0c"
  • channels(root): "nixos-20.09pre226148.0f5ce2fac0c"
  • nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nix

Maintainer information:

attribute: php
@shyim shyim changed the title php packages does not consider anymore /etc/php.d/xxx.ini php package does not consider anymore /etc/php.d/xxx.ini May 27, 2020
@etu
Copy link
Contributor

etu commented May 27, 2020

cc @NixOS/php

@aanderse
Copy link
Member

@shyim correct, this impure side effect inducing behavior was removed. You are encouraged to use php.buildEnv { extraConfig = '''; ini contents here'''; } now. In the case that you need to maintain your current workflow I think between command line options, potentially appending/override PHP_INI_SCAN_DIR, per directory .ini files, and the various phpOptions options we can get a working solution for you - and possibly document it in the manual (though we don't want to encourage this as it introduces impure side effects).

Is your use case php-fpm, mod_php, or simply php from the command line?

@shyim
Copy link
Member Author

shyim commented May 27, 2020

I just want to increase the limit on the cli and all php packages like composer etc

@aanderse
Copy link
Member

@shyim does this satisfy your requirements:

environment.systemPackages =
  let
    php' = pkgs.php.buildEnv { extraConfig = "memory_limit = 2G"; };
  in [
    php'
    php'.packages.composer
  ];

@etu
Copy link
Contributor

etu commented May 28, 2020

I actually didn't know that the old php derivation was impure in this sense.

But if it was, it was bad I'd say. And I'm happy that we fixed that.

But since it was impure before and is pure now we should probably add a mention for that in the release notes for 20.09.

@shyim
Copy link
Member Author

shyim commented May 28, 2020

Thanks @aanderse
Works for me.
So I will close this issue then :)

@shyim shyim closed this as completed May 28, 2020
@shyim
Copy link
Member Author

shyim commented May 28, 2020

@aanderse It seems so that now extensions are missing. How can I get with buildEnv all extensions like the normal?

@aanderse
Copy link
Member

@etu
Copy link
Contributor

etu commented May 28, 2020

@shyim

php.buildEnv {
  extensions = { enabled, ... }: enabled;
  extraConfig = "memory_limit=2G";
}

@NixOS/php It seems weird to me that one would need to define that the default set should be active by changing the config.

EDIT: Maybe we could have a php.withConfig for those who only wants to change the config 🤔. Then people can use withExtensions or withConfig if they only want to do one of the actions and buildEnv for everything at once.

talyz added a commit to talyz/nixpkgs that referenced this issue May 28, 2020
If only extraConfig is specified in buildEnv, keep the currently
enabled extensions active. Brought up in NixOS#89011.
@talyz
Copy link
Contributor

talyz commented May 28, 2020

@etu Yep, buildEnv really should just keep them active when extensions is left unspecified. I opened a pr to fix this (#89132).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants