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

nixos/httpd: fix broken PHP extensions #85402

Merged
merged 5 commits into from Apr 22, 2020
Merged

Conversation

jtojnar
Copy link
Contributor

@jtojnar jtojnar commented Apr 16, 2020

Motivation for this change

Fix PHP extensions not being loaded by the httpd’s PHP module.

Fixes: #85401

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@jtojnar jtojnar requested a review from etu as a code owner April 16, 2020 21:01
@jtojnar jtojnar changed the title nixosTests.php.httpd: init nixos/httpd: fix broken PHP extensions Apr 16, 2020
@jtojnar jtojnar requested a review from talyz April 16, 2020 21:25
@aanderse
Copy link
Member

@jtojnar why is this override not required? What happens when I have this configuration:

services.httpd.package = myCustomApacheHttpd;
services.httpd.phpPackage = myCustomPHP;

Since php requires apacheHttpd the override kinda looks necessary to me... : thinking: Can you please explain what part I have overlooked? Sorry if this is really obvious and I'm just not getting it.

@jtojnar
Copy link
Contributor Author

jtojnar commented Apr 16, 2020

Oops, just meant to remove the .dev part.

@aanderse
Copy link
Member

Oh yes, that's not required. I was going to fix that after #85026 so thanks!

After the recent rewrite, enabled extensions are passed to php programs
through an extra ini file by a wrapper. Since httpd uses shared module
instead of program, the wrapper did not affect it and no extensions
other than built-ins were loaded.

To fix this, we are passing the extension config another way – by adding it
to the service's generated config.

For now we are hardcoding the path to the ini file. It would be nice to add
the path to the passthru and use that once the PHP expression settles down.
@etu
Copy link
Contributor

etu commented Apr 17, 2020

@GrahamcOfBorg test php

@etu
Copy link
Contributor

etu commented Apr 17, 2020

@GrahamcOfBorg build nixosTests.php

@jtojnar jtojnar merged commit b231ac2 into NixOS:master Apr 22, 2020
@jtojnar jtojnar deleted the httpd-php branch April 22, 2020 02:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing PHP extensions in httpd module
4 participants