apacheHttpd+php missing ${php}/modules/ directory (might be a Darwin issue)

Trying to figure out if I stumbled into a macos/darwin issue, a general one, or if I’m just missing something. Useful to hear from anyone using httpd and php on linux or macos…

I tried to write a shell.nix that can start apache httpd with php support for testing a site I need to bugfix, but I had trouble applying the process that the nixos httpd service uses to enable the php module.

For reference, nixpkgs overrides php (php = mainCfg.phpPackage.override { apacheHttpd = httpd.dev; /* otherwise it only gets .out */ };) and adds the module ${php}/modules/libphp${phpMajorVersion}.so to the generated .conf file–but neither php nor php.dev have a modules directory (FWIW: I checked with both php72 and php73):

/nix/store/3acvcsgb56f0y6057nr5mf82nqzb2a43-php-7.2.23-dev:
total 0
dr-xr-xr-x     6 abathur wheel    192 Dec 31  1969 .
drwxr-xr-x 10364 abathur wheel 331648 Nov 29 13:04 ..
dr-xr-xr-x     4 abathur wheel    128 Dec 31  1969 bin
dr-xr-xr-x     3 abathur wheel     96 Dec 31  1969 include
dr-xr-xr-x     3 abathur wheel     96 Dec 31  1969 nix-support
dr-xr-xr-x     3 abathur wheel     96 Dec 31  1969 share

/nix/store/gd42fl8wdmrr2x8ha0gnmlr5rgx4bdb2-php-7.2.23:
total 0
dr-xr-xr-x     9 abathur wheel    288 Dec 31  1969 .
drwxr-xr-x 10364 abathur wheel 331648 Nov 29 13:04 ..
dr-xr-xr-x    11 abathur wheel    352 Dec 31  1969 bin
dr-xr-xr-x     6 abathur wheel    192 Dec 31  1969 etc
dr-xr-xr-x     4 abathur wheel    128 Dec 31  1969 lib
dr-xr-xr-x     3 abathur wheel     96 Dec 31  1969 php
lrwxr-xr-x     1 abathur wheel      3 Dec 31  1969 sbin -> bin
dr-xr-xr-x     3 abathur wheel     96 Dec 31  1969 share
dr-xr-xr-x     4 abathur wheel    128 Dec 31  1969 var

The only .so file I found in either path is /nix/store/gd42fl8wdmrr2x8ha0gnmlr5rgx4bdb2-php-7.2.23/lib/php/extensions/opcache.so

As mentioned in your post you’re looking for php.override { apacheHttpd = pkgs.apacheHttpd.dev; }, not php or php.dev. Alternatively you could use php-fpm.

I am already doing the former (haven’t tried fpm, yet). Stripped-down version:

{ pkgs ? import <nixpkgs> {} }:

let
  php = pkgs.php72.override { apacheHttpd = pkgs.apacheHttpd.dev; };
in
  pkgs.stdenv.mkDerivation rec {
    name = "php-project";
    buildInputs = [
      pkgs.apacheHttpd
      php
    ];
    apacheConfigFile = pkgs.writeText "test.conf" ''
    ServerRoot ${pkgs.apacheHttpd.dev.out}

    # Minimum modules needed
    LoadModule php7_module ${php}/modules/libphp7.so
    '';

    shellHook = ''
    ls ${php}/modules
    httpd -f ${apacheConfigFile} -k start -X
    '';
  }

AFAIK, the most-relevant/equivalent lines in the nixos module are

$ nix-shell
these derivations will be built:
  /nix/store/v48yan2xpzkz77sa2lfp145h05r4m750-test.conf.drv
building '/nix/store/v48yan2xpzkz77sa2lfp145h05r4m750-test.conf.drv'...
ls: cannot access '/nix/store/gd42fl8wdmrr2x8ha0gnmlr5rgx4bdb2-php-7.2.23/modules': No such file or directory
httpd: Syntax error on line 4 of /nix/store/4x5pbps2p5hxncg414s6brxg568f7a4w-test.conf: Cannot load /nix/store/gd42fl8wdmrr2x8ha0gnmlr5rgx4bdb2-php-7.2.23/modules/libphp7.so into server: dlopen(/nix/store/gd42fl8wdmrr2x8ha0gnmlr5rgx4bdb2-php-7.2.23/modules/libphp7.so, 10): image not found

I don’t have a mac to test, but it sounds like a bug in our php build for darwin. What you are doing is correct as far as I can tell.

I’ll file a report tomorrow.

Looks like this is the culprit:

nixpkgs.config.php.apxs2 = true; might get you sorted, unless there was a reason that option is disabled on darwin.

It seems there was a reason (see https://github.com/NixOS/nixpkgs/pull/16078), but neither the PR nor the initial issue (https://github.com/NixOS/nixpkgs/issues/15818) clarify anything beyond that build was broken.

I gave the config change a try last night, but build failed after about 15 minutes. Here’s a condensed version of the log:

$ nix-shell
these derivations will be built:
  /nix/store/v3r0fa4xwz8qfnq9510ra765jclqls6b-php-7.2.23.drv
  /nix/store/bdgdbvr94n0bnh7x6lm12xwxd4vlkvhr-test.conf.drv
these paths will be fetched (166.80 MiB download, 756.73 MiB unpacked):
  /nix/store/4zqw3krn4llhsir8qbygwysr85jsz9cg-clang-6.0.1
  /nix/store/81rbv8wakkhrk2rdw9cpx26y6fwd1zx8-valgrind-3.15.0
  /nix/store/d65xma4pygyadqr83j1577gjm76ks1d6-stdenv-darwin
  /nix/store/g7jkxwncnmy3a400f58dx05adlfq2zda-bison-3.4.2
  /nix/store/g7npl7scnagcppp58yqq8jbm2vx7084d-libtool-2.4.6
  /nix/store/gqsx97xbg7gkmhcwv1zf2yxvc2qd9k2r-expand-response-params
  /nix/store/h8r7xdxmgak51wdhq4hbysgp8kn1rhkm-xnu-osx-10.12.6
  /nix/store/hc2k4md467rxsbknwv2kqgyaywa5i6si-bzip2-1.0.6.0.1-dev
  /nix/store/i2frpm0pilfzpmdi98jpdvf7k79hmv6w-clang-6.0.1-lib
  /nix/store/kjby3g8cmpxlqkq7l6iba6lb7wxymmlv-php-7.2.23.tar.bz2
  /nix/store/l54jfcm4762b0sk2x6qzxa4ji7yyim29-autoconf-2.69
  /nix/store/qali461nxgxgm5fwyc7vmkaiwpw8z1sv-hook
  /nix/store/qjhkspbcw23l0kiacrdgxn7i2z2s337n-compiler-rt-6.0.1-dev
  /nix/store/ql556xb1xahyrjjr85a6ngx96hy80xrx-valgrind-3.15.0-dev
  /nix/store/qrii0hqpr7z4dhc19hr6z1awzij9vnan-clang-wrapper-6.0.1
  /nix/store/vj2v41ym23rgrz63pl61wii8m85zz5fi-gdb-8.3.1
  /nix/store/vwwsn3ycykazw6rqj5sk2i66wqy5rzl9-mpfr-4.0.2
  /nix/store/w6cbal0q4yll6lh0i6cngly9i8ch6c3n-compiler-rt-6.0.1
  /nix/store/xvrsr3lcm1afv7djds7grs40lbxrcfjh-libipt-2.0.1
  /nix/store/zw5h6zrlpnp2jpabyxqzr32lg0w8hmjp-freetype-2.10.1-dev
  /nix/store/zzddycylkhl31yh4hbnfyvyb0d2yl4dd-re2c-1.0.3
copying path '/nix/store/kjby3g8cmpxlqkq7l6iba6lb7wxymmlv-php-7.2.23.tar.bz2' from 'https://cache.nixos.org'...
copying path '/nix/store/l54jfcm4762b0sk2x6qzxa4ji7yyim29-autoconf-2.69' from 'https://cache.nixos.org'...
copying path '/nix/store/g7jkxwncnmy3a400f58dx05adlfq2zda-bison-3.4.2' from 'https://cache.nixos.org'...
copying path '/nix/store/qali461nxgxgm5fwyc7vmkaiwpw8z1sv-hook' from 'https://cache.nixos.org'...
copying path '/nix/store/hc2k4md467rxsbknwv2kqgyaywa5i6si-bzip2-1.0.6.0.1-dev' from 'https://cache.nixos.org'...
copying path '/nix/store/i2frpm0pilfzpmdi98jpdvf7k79hmv6w-clang-6.0.1-lib' from 'https://cache.nixos.org'...
copying path '/nix/store/w6cbal0q4yll6lh0i6cngly9i8ch6c3n-compiler-rt-6.0.1' from 'https://cache.nixos.org'...
copying path '/nix/store/gqsx97xbg7gkmhcwv1zf2yxvc2qd9k2r-expand-response-params' from 'https://cache.nixos.org'...
copying path '/nix/store/zw5h6zrlpnp2jpabyxqzr32lg0w8hmjp-freetype-2.10.1-dev' from 'https://cache.nixos.org'...
copying path '/nix/store/xvrsr3lcm1afv7djds7grs40lbxrcfjh-libipt-2.0.1' from 'https://cache.nixos.org'...
copying path '/nix/store/g7npl7scnagcppp58yqq8jbm2vx7084d-libtool-2.4.6' from 'https://cache.nixos.org'...
copying path '/nix/store/qjhkspbcw23l0kiacrdgxn7i2z2s337n-compiler-rt-6.0.1-dev' from 'https://cache.nixos.org'...
copying path '/nix/store/vwwsn3ycykazw6rqj5sk2i66wqy5rzl9-mpfr-4.0.2' from 'https://cache.nixos.org'...
copying path '/nix/store/zzddycylkhl31yh4hbnfyvyb0d2yl4dd-re2c-1.0.3' from 'https://cache.nixos.org'...
copying path '/nix/store/h8r7xdxmgak51wdhq4hbysgp8kn1rhkm-xnu-osx-10.12.6' from 'https://cache.nixos.org'...
copying path '/nix/store/vj2v41ym23rgrz63pl61wii8m85zz5fi-gdb-8.3.1' from 'https://cache.nixos.org'...
copying path '/nix/store/81rbv8wakkhrk2rdw9cpx26y6fwd1zx8-valgrind-3.15.0' from 'https://cache.nixos.org'...
copying path '/nix/store/4zqw3krn4llhsir8qbygwysr85jsz9cg-clang-6.0.1' from 'https://cache.nixos.org'...
copying path '/nix/store/ql556xb1xahyrjjr85a6ngx96hy80xrx-valgrind-3.15.0-dev' from 'https://cache.nixos.org'...
copying path '/nix/store/qrii0hqpr7z4dhc19hr6z1awzij9vnan-clang-wrapper-6.0.1' from 'https://cache.nixos.org'...
copying path '/nix/store/d65xma4pygyadqr83j1577gjm76ks1d6-stdenv-darwin' from 'https://cache.nixos.org'...
building '/nix/store/v3r0fa4xwz8qfnq9510ra765jclqls6b-php-7.2.23.drv'...
...2665 lines omitted...
/nix/store/6qxm90a0xizaw6vgc40924a4cfmv3h73-bash-4.4-p23/bin/bash /private/var/folders/8g/qgvf93_s1_b40dd8nhsvqk_m0000gn/T/nix-build-php-7.2.23.drv-0/php-7.2.23/libtool --silent --preserve-dup-deps --mode=link /private/var/folders/8g/qgvf93_s1_b40dd8nhsvqk_m0000gn/T/nix-build-php-7.2.23.drv-0/php-7.2.23/meta_ccld -DPHP_ATOM_INC -I/private/var/folders/8g/qgvf93_s1_b40dd8nhsvqk_m0000gn/T/nix-build-php-7.2.23.drv-0/php-7.2.23/include -I/private/var/folders/8g/qgvf93_s1_b40dd8nhsvqk_m0000gn/T/nix-build-php-7.2.23.drv-0/php-7.2.23/main -I/private/var/folders/8g/qgvf93_s1_b40dd8nhsvqk_m0000gn/T/nix-build-php-7.2.23.drv-0/php-7.2.23 -I/private/var/folders/8g/qgvf93_s1_b40dd8nhsvqk_m0000gn/T/nix-build-php-7.2.23.drv-0/php-7.2.23/ext/date/lib -I/nix/store/afafvxrlxydwrf8r6w5xw3n2ff5gy0ld-libxml2-2.9.9-dev/include/libxml2 -I/nix/store/0d7j385n62q394jpj30jd1dhk1x36dq5-openssl-1.1.1d-dev/include -I/nix/store/g9yq64drdksxd0plwc1imp50936lshhd-pcre-8.43-dev/include -I/nix/store/3n6hl6id63qaj0ii64kq1xnj33zvmzw2-zlib-1.2.11-dev/include -I/nix/store/ikhvdbq3sh7m7718w6xs5id0w56wkwdi-curl-7.66.0-dev/include -I/nix/store/aq158zh2fxhcqhsv0j645a8n2c8n8kdd-libjpeg-turbo-2.0.3-dev/include -I/nix/store/swmv6jn8164f9ja7qcc8bghmldi7qdf3-libpng-apng-1.6.37-dev/include -I/nix/store/zw5h6zrlpnp2jpabyxqzr32lg0w8hmjp-freetype-2.10.1-dev/include/freetype2 -I/nix/store/8wn0zg0jx82kqh7aymnd860mkqvkib3s-gettext-0.19.8.1/include -I/nix/store/8fvxv9y4xr89k5rzcf0v75mz8amabxam-gmp-6.1.2-dev/include -I/nix/store/rsv2rsgma1nwj77gyphnhhbf4y2ks7ah-libiconv-osx-10.12.6/include -I/nix/store/4x2g1jili6jbklppqn76vqp1mw25q2cx-icu4c-64.2-dev/include -I/nix/store/c45kbxqp548fhd0ncc4vxcjs69pnhc69-openldap-2.4.48-dev/include -I/private/var/folders/8g/qgvf93_s1_b40dd8nhsvqk_m0000gn/T/nix-build-php-7.2.23.drv-0/php-7.2.23/ext/mbstring/oniguruma -I/private/var/folders/8g/qgvf93_s1_b40dd8nhsvqk_m0000gn/T/nix-build-php-7.2.23.drv-0/php-7.2.23/ext/mbstring/libmbfl -I/private/var/folders/8g/qgvf93_s1_b40dd8nhsvqk_m0000gn/T/nix-build-php-7.2.23.drv-0/php-7.2.23/ext/mbstring/libmbfl/mbfl -I/nix/store/ncj1rh5ri9hyzwg6gracfd2bc1cv3wal-postgresql-11.5/include -I/nix/store/9w0kbbajplqkddsdrnhhz58habc1h17f-sqlite-3.28.0-dev/include -I/nix/store/6w2m6hp3c024lnfk1n5lg7qgcyi42nwd-readline-6.3p08-dev/include -I/nix/store/g10q11rs28lhpiz8zbsni6v36vzy70ib-libsodium-1.0.18-dev/include -I/nix/store/rdwjvgfbyv50si2galx7rfmnd1flih65-libargon2-20190702/include -I/nix/store/f1pnfxpigy01mvd16cljnrravi7nb1s2-libzip-1.3.0-dev/include -I/private/var/folders/8g/qgvf93_s1_b40dd8nhsvqk_m0000gn/T/nix-build-php-7.2.23.drv-0/php-7.2.23/TSRM -I/private/var/folders/8g/qgvf93_s1_b40dd8nhsvqk_m0000gn/T/nix-build-php-7.2.23.drv-0/php-7.2.23/Zend  -no-cpp-precomp  -I/nix/store/rsv2rsgma1nwj77gyphnhhbf4y2ks7ah-libiconv-osx-10.12.6/include -g -O2 -fvisibility=hidden -pthread -DZTS -DZEND_SIGNALS     -o ext/opcache/opcache.la -export-dynamic -avoid-version -prefer-pic -module -rpath /private/var/folders/8g/qgvf93_s1_b40dd8nhsvqk_m0000gn/T/nix-build-php-7.2.23.drv-0/php-7.2.23/modules -L/nix/store/xnq9y6qnfvfk2fp7iphci5k03d1y7vwg-libxml2-2.9.9/lib -L/nix/store/vhwhaaf5yalz8pgj2kif1mknh0g37b8f-openssl-1.1.1d/lib -L/nix/store/bsxfi81hdwgjg76y0ck9aggnfxfwx9lf-pcre-8.43-bin -L/nix/store/3n6hl6id63qaj0ii64kq1xnj33zvmzw2-zlib-1.2.11-dev/lib -L/nix/store/9qkjpixsj5ac96xv1q9i9l5glyg00scg-curl-7.66.0/lib -L/nix/store/aq158zh2fxhcqhsv0j645a8n2c8n8kdd-libjpeg-turbo-2.0.3-dev/lib -L/nix/store/swmv6jn8164f9ja7qcc8bghmldi7qdf3-libpng-apng-1.6.37-dev/lib -L/nix/store/ivhysj6b8yi0zyzqnz2gsk8mf57cwfga-freetype-2.10.1/lib -L/nix/store/8wn0zg0jx82kqh7aymnd860mkqvkib3s-gettext-0.19.8.1/lib -L/nix/store/8fvxv9y4xr89k5rzcf0v75mz8amabxam-gmp-6.1.2-dev/lib -L/nix/store/rsv2rsgma1nwj77gyphnhhbf4y2ks7ah-libiconv-osx-10.12.6/lib -L/nix/store/3bya1xdla9knwfsd1irk0ym1bf0q93b1-icu4c-64.2/lib -L/nix/store/kwqrbay23i7x7ii0xawsa96a463yxdl3-openldap-2.4.48/lib -L/nix/store/ddnhcfdjgxgjjmyarcwbp82gkrjhfx3c-unixODBC-2.3.7/lib -L/nix/store/z1nrvnkic1s2fhxs789sa8hcyznnsrkl-postgresql-11.5-lib/lib -L/nix/store/9w0kbbajplqkddsdrnhhz58habc1h17f-sqlite-3.28.0-dev/lib -L/nix/store/6w2m6hp3c024lnfk1n5lg7qgcyi42nwd-readline-6.3p08-dev/lib -L/nix/store/g10q11rs28lhpiz8zbsni6v36vzy70ib-libsodium-1.0.18-dev/lib -L/nix/store/rdwjvgfbyv50si2galx7rfmnd1flih65-libargon2-20190702/lib -L/nix/store/f1pnfxpigy01mvd16cljnrravi7nb1s2-libzip-1.3.0-dev/lib ext/opcache/ZendAccelerator.lo ext/opcache/zend_accelerator_blacklist.lo ext/opcache/zend_accelerator_debug.lo ext/opcache/zend_accelerator_hash.lo ext/opcache/zend_accelerator_module.lo ext/opcache/zend_persist.lo ext/opcache/zend_persist_calc.lo ext/opcache/zend_file_cache.lo ext/opcache/zend_shared_alloc.lo ext/opcache/zend_accelerator_util_funcs.lo ext/opcache/shared_alloc_shm.lo ext/opcache/shared_alloc_mmap.lo ext/opcache/shared_alloc_posix.lo ext/opcache/Optimizer/zend_optimizer.lo ext/opcache/Optimizer/pass1_5.lo ext/opcache/Optimizer/pass2.lo ext/opcache/Optimizer/pass3.lo ext/opcache/Optimizer/optimize_func_calls.lo ext/opcache/Optimizer/block_pass.lo ext/opcache/Optimizer/optimize_temp_vars_5.lo ext/opcache/Optimizer/nop_removal.lo ext/opcache/Optimizer/compact_literals.lo ext/opcache/Optimizer/zend_cfg.lo ext/opcache/Optimizer/zend_dfg.lo ext/opcache/Optimizer/dfa_pass.lo ext/opcache/Optimizer/zend_ssa.lo ext/opcache/Optimizer/zend_inference.lo ext/opcache/Optimizer/zend_func_info.lo ext/opcache/Optimizer/zend_call_graph.lo ext/opcache/Optimizer/sccp.lo ext/opcache/Optimizer/scdf.lo ext/opcache/Optimizer/dce.lo ext/opcache/Optimizer/compact_vars.lo ext/opcache/Optimizer/zend_dump.lo 
ld: warning: directory not found for option '-L/nix/store/8fvxv9y4xr89k5rzcf0v75mz8amabxam-gmp-6.1.2-dev/lib'
ld: warning: directory not found for option '-L/nix/store/6w2m6hp3c024lnfk1n5lg7qgcyi42nwd-readline-6.3p08-dev/lib'
Undefined symbols for architecture x86_64:
  "thread-local wrapper routine for _tsrm_ls_cache", referenced from:
      _zim_IntlDateFormatter___construct in dateformat_create.o
      _timezone_convert_to_datetimezone in timezone_class.o
      _zif_intlcal_from_date_time in calendar_methods.o
      _zif_intlcal_to_date_time in calendar_methods.o
      _php_intlgregcal_constructor_body(_zend_execute_data*, _zval_struct*, unsigned char) in gregoriancalendar_methods.o
ld: symbol(s) not found for architecture x86_64
clang-6.0: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Makefile:172: libs/libphp7.bundle] Error 1
make: *** Waiting for unfinished jobs....
1 warning generated.
ld: warning: directory not found for option '-L/nix/store/8fvxv9y4xr89k5rzcf0v75mz8amabxam-gmp-6.1.2-dev/lib'
ld: warning: directory not found for option '-L/nix/store/6w2m6hp3c024lnfk1n5lg7qgcyi42nwd-readline-6.3p08-dev/lib'
/nix/store/hm3ry296drska2inwl3xkwxap07wv2gs-cctools-port-895/bin/ranlib: file: ext/opcache/.libs/opcache.a(shared_alloc_shm.o) has no symbols
ranlib: file: ext/opcache/.libs/opcache.a(shared_alloc_shm.o) has no symbols
builder for '/nix/store/v3r0fa4xwz8qfnq9510ra765jclqls6b-php-7.2.23.drv' failed with exit code 2
error: build of '/nix/store/bdgdbvr94n0bnh7x6lm12xwxd4vlkvhr-test.conf.drv', '/nix/store/v3r0fa4xwz8qfnq9510ra765jclqls6b-php-7.2.23.drv' failed

To avoid packing too much in this post, I’ll follow up with more in a few minutes.

I found a report (https://bugs.php.net/bug.php?id=77996&edit=1) of a break at the same location that mentioned disabling intl support, so I tried to build again just now with php.intl = false;

This does leapfrog the linker failure from the previous post, but it promptly falls over when it tries to install libphp.so into httpd in the nix store:

/nix/store/6qxm90a0xizaw6vgc40924a4cfmv3h73-bash-4.4-p23/bin/bash /private/var/folders/8g/qgvf93_s1_b40dd8nhsvqk_m0000gn/T/nix-build-php-7.2.23.drv-0/php-7.2.23/libtool --silent --preserve-dup-deps --mode=link /private/var/folders/8g/qgvf93_s1_b40dd8nhsvqk_m0000gn/T/nix-build-php-7.2.23.drv-0/php-7.2.23/meta_ccld -DPHP_ATOM_INC -I/private/var/folders/8g/qgvf93_s1_b40dd8nhsvqk_m0000gn/T/nix-build-php-7.2.23.drv-0/php-7.2.23/include -I/private/var/folders/8g/qgvf93_s1_b40dd8nhsvqk_m0000gn/T/nix-build-php-7.2.23.drv-0/php-7.2.23/main -I/private/var/folders/8g/qgvf93_s1_b40dd8nhsvqk_m0000gn/T/nix-build-php-7.2.23.drv-0/php-7.2.23 -I/private/var/folders/8g/qgvf93_s1_b40dd8nhsvqk_m0000gn/T/nix-build-php-7.2.23.drv-0/php-7.2.23/ext/date/lib -I/nix/store/afafvxrlxydwrf8r6w5xw3n2ff5gy0ld-libxml2-2.9.9-dev/include/libxml2 -I/nix/store/0d7j385n62q394jpj30jd1dhk1x36dq5-openssl-1.1.1d-dev/include -I/nix/store/g9yq64drdksxd0plwc1imp50936lshhd-pcre-8.43-dev/include -I/nix/store/3n6hl6id63qaj0ii64kq1xnj33zvmzw2-zlib-1.2.11-dev/include -I/nix/store/ikhvdbq3sh7m7718w6xs5id0w56wkwdi-curl-7.66.0-dev/include -I/nix/store/aq158zh2fxhcqhsv0j645a8n2c8n8kdd-libjpeg-turbo-2.0.3-dev/include -I/nix/store/swmv6jn8164f9ja7qcc8bghmldi7qdf3-libpng-apng-1.6.37-dev/include -I/nix/store/zw5h6zrlpnp2jpabyxqzr32lg0w8hmjp-freetype-2.10.1-dev/include/freetype2 -I/nix/store/8wn0zg0jx82kqh7aymnd860mkqvkib3s-gettext-0.19.8.1/include -I/nix/store/8fvxv9y4xr89k5rzcf0v75mz8amabxam-gmp-6.1.2-dev/include -I/nix/store/rsv2rsgma1nwj77gyphnhhbf4y2ks7ah-libiconv-osx-10.12.6/include -I/nix/store/c45kbxqp548fhd0ncc4vxcjs69pnhc69-openldap-2.4.48-dev/include -I/private/var/folders/8g/qgvf93_s1_b40dd8nhsvqk_m0000gn/T/nix-build-php-7.2.23.drv-0/php-7.2.23/ext/mbstring/oniguruma -I/private/var/folders/8g/qgvf93_s1_b40dd8nhsvqk_m0000gn/T/nix-build-php-7.2.23.drv-0/php-7.2.23/ext/mbstring/libmbfl -I/private/var/folders/8g/qgvf93_s1_b40dd8nhsvqk_m0000gn/T/nix-build-php-7.2.23.drv-0/php-7.2.23/ext/mbstring/libmbfl/mbfl -I/nix/store/ncj1rh5ri9hyzwg6gracfd2bc1cv3wal-postgresql-11.5/include -I/nix/store/9w0kbbajplqkddsdrnhhz58habc1h17f-sqlite-3.28.0-dev/include -I/nix/store/6w2m6hp3c024lnfk1n5lg7qgcyi42nwd-readline-6.3p08-dev/include -I/nix/store/g10q11rs28lhpiz8zbsni6v36vzy70ib-libsodium-1.0.18-dev/include -I/nix/store/rdwjvgfbyv50si2galx7rfmnd1flih65-libargon2-20190702/include -I/nix/store/f1pnfxpigy01mvd16cljnrravi7nb1s2-libzip-1.3.0-dev/include -I/private/var/folders/8g/qgvf93_s1_b40dd8nhsvqk_m0000gn/T/nix-build-php-7.2.23.drv-0/php-7.2.23/TSRM -I/private/var/folders/8g/qgvf93_s1_b40dd8nhsvqk_m0000gn/T/nix-build-php-7.2.23.drv-0/php-7.2.23/Zend  -no-cpp-precomp  -I/nix/store/rsv2rsgma1nwj77gyphnhhbf4y2ks7ah-libiconv-osx-10.12.6/include -g -O2 -fvisibility=hidden -pthread -DZTS -DZEND_SIGNALS     -o ext/opcache/opcache.la -export-dynamic -avoid-version -prefer-pic -module -rpath /private/var/folders/8g/qgvf93_s1_b40dd8nhsvqk_m0000gn/T/nix-build-php-7.2.23.drv-0/php-7.2.23/modules -L/nix/store/xnq9y6qnfvfk2fp7iphci5k03d1y7vwg-libxml2-2.9.9/lib -L/nix/store/vhwhaaf5yalz8pgj2kif1mknh0g37b8f-openssl-1.1.1d/lib -L/nix/store/bsxfi81hdwgjg76y0ck9aggnfxfwx9lf-pcre-8.43-bin -L/nix/store/3n6hl6id63qaj0ii64kq1xnj33zvmzw2-zlib-1.2.11-dev/lib -L/nix/store/9qkjpixsj5ac96xv1q9i9l5glyg00scg-curl-7.66.0/lib -L/nix/store/aq158zh2fxhcqhsv0j645a8n2c8n8kdd-libjpeg-turbo-2.0.3-dev/lib -L/nix/store/swmv6jn8164f9ja7qcc8bghmldi7qdf3-libpng-apng-1.6.37-dev/lib -L/nix/store/ivhysj6b8yi0zyzqnz2gsk8mf57cwfga-freetype-2.10.1/lib -L/nix/store/8wn0zg0jx82kqh7aymnd860mkqvkib3s-gettext-0.19.8.1/lib -L/nix/store/8fvxv9y4xr89k5rzcf0v75mz8amabxam-gmp-6.1.2-dev/lib -L/nix/store/rsv2rsgma1nwj77gyphnhhbf4y2ks7ah-libiconv-osx-10.12.6/lib -L/nix/store/kwqrbay23i7x7ii0xawsa96a463yxdl3-openldap-2.4.48/lib -L/nix/store/ddnhcfdjgxgjjmyarcwbp82gkrjhfx3c-unixODBC-2.3.7/lib -L/nix/store/z1nrvnkic1s2fhxs789sa8hcyznnsrkl-postgresql-11.5-lib/lib -L/nix/store/9w0kbbajplqkddsdrnhhz58habc1h17f-sqlite-3.28.0-dev/lib -L/nix/store/6w2m6hp3c024lnfk1n5lg7qgcyi42nwd-readline-6.3p08-dev/lib -L/nix/store/g10q11rs28lhpiz8zbsni6v36vzy70ib-libsodium-1.0.18-dev/lib -L/nix/store/rdwjvgfbyv50si2galx7rfmnd1flih65-libargon2-20190702/lib -L/nix/store/f1pnfxpigy01mvd16cljnrravi7nb1s2-libzip-1.3.0-dev/lib ext/opcache/ZendAccelerator.lo ext/opcache/zend_accelerator_blacklist.lo ext/opcache/zend_accelerator_debug.lo ext/opcache/zend_accelerator_hash.lo ext/opcache/zend_accelerator_module.lo ext/opcache/zend_persist.lo ext/opcache/zend_persist_calc.lo ext/opcache/zend_file_cache.lo ext/opcache/zend_shared_alloc.lo ext/opcache/zend_accelerator_util_funcs.lo ext/opcache/shared_alloc_shm.lo ext/opcache/shared_alloc_mmap.lo ext/opcache/shared_alloc_posix.lo ext/opcache/Optimizer/zend_optimizer.lo ext/opcache/Optimizer/pass1_5.lo ext/opcache/Optimizer/pass2.lo ext/opcache/Optimizer/pass3.lo ext/opcache/Optimizer/optimize_func_calls.lo ext/opcache/Optimizer/block_pass.lo ext/opcache/Optimizer/optimize_temp_vars_5.lo ext/opcache/Optimizer/nop_removal.lo ext/opcache/Optimizer/compact_literals.lo ext/opcache/Optimizer/zend_cfg.lo ext/opcache/Optimizer/zend_dfg.lo ext/opcache/Optimizer/dfa_pass.lo ext/opcache/Optimizer/zend_ssa.lo ext/opcache/Optimizer/zend_inference.lo ext/opcache/Optimizer/zend_func_info.lo ext/opcache/Optimizer/zend_call_graph.lo ext/opcache/Optimizer/sccp.lo ext/opcache/Optimizer/scdf.lo ext/opcache/Optimizer/dce.lo ext/opcache/Optimizer/compact_vars.lo ext/opcache/Optimizer/zend_dump.lo 
ld: warning: directory not found for option '-L/nix/store/8fvxv9y4xr89k5rzcf0v75mz8amabxam-gmp-6.1.2-dev/lib'
ld: warning: directory not found for option '-L/nix/store/6w2m6hp3c024lnfk1n5lg7qgcyi42nwd-readline-6.3p08-dev/lib'
/nix/store/hm3ry296drska2inwl3xkwxap07wv2gs-cctools-port-895/bin/ranlib: file: ext/opcache/.libs/opcache.a(shared_alloc_shm.o) has no symbols
ranlib: file: ext/opcache/.libs/opcache.a(shared_alloc_shm.o) has no symbols
/nix/store/6qxm90a0xizaw6vgc40924a4cfmv3h73-bash-4.4-p23/bin/bash /private/var/folders/8g/qgvf93_s1_b40dd8nhsvqk_m0000gn/T/nix-build-php-7.2.23.drv-0/php-7.2.23/libtool --silent --preserve-dup-deps --mode=install cp ext/opcache/opcache.la /private/var/folders/8g/qgvf93_s1_b40dd8nhsvqk_m0000gn/T/nix-build-php-7.2.23.drv-0/php-7.2.23/modules
ranlib: file: /private/var/folders/8g/qgvf93_s1_b40dd8nhsvqk_m0000gn/T/nix-build-php-7.2.23.drv-0/php-7.2.23/modules/opcache.a(shared_alloc_shm.o) has no symbols
ld: warning: directory not found for option '-L/nix/store/8fvxv9y4xr89k5rzcf0v75mz8amabxam-gmp-6.1.2-dev/lib'
ld: warning: directory not found for option '-L/nix/store/6w2m6hp3c024lnfk1n5lg7qgcyi42nwd-readline-6.3p08-dev/lib'

Build complete.
Don't forget to run 'make test'.

installing
install flags: SHELL=/nix/store/6qxm90a0xizaw6vgc40924a4cfmv3h73-bash-4.4-p23/bin/bash pkgconfigdir=/nix/store/fg1fmmmjkmcf8snwlx3bkxs10d0wl68d-php-7.2.23-dev/lib/pkgconfig m4datadir=/nix/store/fg1fmmmjkmcf8snwlx3bkxs10d0wl68d-php-7.2.23-dev/share/aclocal aclocaldir=/nix/store/fg1fmmmjkmcf8snwlx3bkxs10d0wl68d-php-7.2.23-dev/share/aclocal install
Installing PHP SAPI module:       apache2handler
/nix/store/m4dwpa3k342c3v9z6g0s7d5kvvzjm8k7-apache-httpd-2.4.41-dev/share/build/instdso.sh SH_LIBTOOL='/nix/store/nnssljs9jg214bw32ysxkxipvl8ak09z-apr-1.6.5-dev/share/build/libtool' libs/libphp7.so /nix/store/74dl41c9860k7wgdx7azn9h00r8r6rb6-apache-httpd-2.4.41/modules
/nix/store/nnssljs9jg214bw32ysxkxipvl8ak09z-apr-1.6.5-dev/share/build/libtool --mode=install install libs/libphp7.so /nix/store/74dl41c9860k7wgdx7azn9h00r8r6rb6-apache-httpd-2.4.41/modules/
libtool: install: install libs/libphp7.so /nix/store/74dl41c9860k7wgdx7azn9h00r8r6rb6-apache-httpd-2.4.41/modules/libphp7.so
install: cannot create regular file '/nix/store/74dl41c9860k7wgdx7azn9h00r8r6rb6-apache-httpd-2.4.41/modules/libphp7.so': Permission denied
apxs:Error: Command failed with rc=65536
.
make: *** [Makefile:179: install-sapi] Error 1
builder for '/nix/store/i8bp6003a9k3lizcayq3zq9gav3mjrkm-php-7.2.23.drv' failed with exit code 2
error: build of '/nix/store/h6hw1ir3hwv80ps24f4ihjw4hx318lyl-test.conf.drv', '/nix/store/i8bp6003a9k3lizcayq3zq9gav3mjrkm-php-7.2.23.drv' failed

@aanderse Thanks for mentioning php-fpm here, by the way. I used it to get what I needed working this afternoon.

I haven’t done much php for several years and am trying to translate old Vagrant/Chef configs (which used mod_php5) over to Nix. It might’ve taken me a while longer to step back from the trees and realize I don’t need to load a php module. :slight_smile: