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: enable nts flags by default #194172

Merged
merged 1 commit into from
Nov 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions nixos/doc/manual/from_md/release-notes/rl-2211.section.xml
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,15 @@
PHP now defaults to PHP 8.1, updated from 8.0.
</para>
</listitem>
<listitem>
<para>
PHP is now built <literal>NTS</literal> (Non-Thread Safe)
style by default, for Apache and <literal>mod_php</literal>
usage we still enable <literal>ZTS</literal> (Zend Thread
Safe). This has been a common practice for a long time in
other distributions.
</para>
</listitem>
<listitem>
<para>
<literal>protonup</literal> has been aliased to and replaced
Expand Down
4 changes: 4 additions & 0 deletions nixos/doc/manual/release-notes/rl-2211.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ In addition to numerous new and upgraded packages, this release has the followin

- PHP now defaults to PHP 8.1, updated from 8.0.

- PHP is now built `NTS` (Non-Thread Safe) style by default, for Apache and
`mod_php` usage we still enable `ZTS` (Zend Thread Safe). This has been a
common practice for a long time in other distributions.

- `protonup` has been aliased to and replaced by `protonup-ng` due to upstream not maintaining it.

- Perl has been updated to 5.36, and its core module `HTTP::Tiny` was patched to verify SSL/TLS certificates by default.
Expand Down
9 changes: 8 additions & 1 deletion nixos/modules/services/web-servers/apache-httpd/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ let
sed -i $out/bin/apachectl -e 's|$HTTPD -t|$HTTPD -t -f /etc/httpd/httpd.conf|'
'';

php = cfg.phpPackage.override { apacheHttpd = pkg; };
php = cfg.phpPackage.override { apxs2Support = true; apacheHttpd = pkg; };

phpModuleName = let
majorVersion = lib.versions.major (lib.getVersion php);
Expand Down Expand Up @@ -660,6 +660,13 @@ in
`services.httpd.virtualHosts.<name>.useACMEHost` are mutually exclusive.
'';
}
{
assertion = cfg.enablePHP -> php.ztsSupport;
message = ''
The php package provided by `services.httpd.phpPackage` is not built with zts support. Please
ensure the php has zts support by settings `services.httpd.phpPackage = php.override { ztsSupport = true; }`
'';
}
] ++ map (name: mkCertOwnershipAssertion {
inherit (cfg) group user;
cert = config.security.acme.certs.${name};
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/interpreters/php/generic.nix
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ let
, phpdbgSupport ? true

# Misc flags
, apxs2Support ? !stdenv.isDarwin
, apxs2Support ? false
, argon2Support ? true
, cgotoSupport ? false
, embedSupport ? false
Expand Down