Skip to content

php-8.1.27 php_module fails to load with Apache 2.4.58 on Solaris-SPARC 5.11 #14234

@mjetzer

Description

@mjetzer

Description

This is a continuation of an issue reported by my colleague: #13725

We're compiling PHP, including OCI8 support, using DeveloperStudio 12.6 and intending to use it as a module with Apache 2.4.58.

Hicham eventually got things to successfully compile and pass a reasonable number of regression tests (i.e., sapi/cli/php works). However, using the corresponding Apache module causes Apache startup (including just doing an "apachectl configtest") to fail with
httpd: Syntax error on line 155 of /usr/local/apache_2.4.58-ora_12.2.0-mb/conf/httpd.conf: Can't locate API module structure 'php_module' in file /usr/local/apache_2.4.58-ora_12.2.0-mb/modules/libphp.so: ld.so.1: httpd: php_module: can't find symbol

PHP is configured using (--disable-opcache and --without-pcre-jit used to address issues with previous compilation requests):

CC="cc -m64 -xcode=pic32" \
ONIG_CFLAGS=-I$onig_tmp_installation_dir/include \
ONIG_LIBS="-L$onig_tmp_installation_dir/lib -lonig" \
ZLIB_CFLAGS=-I$zlib_install_dir/include \
ZLIB_LIBS="-L$zlib_install_dir/lib -lz" \
PCRE2_CFLAGS=-I$pcre_tmp_installation_dir/include \
PCRE2_LIBS="-L$pcre_tmp_installation_dir/lib -lpcre2-8" \
./configure \
    --with-apxs2=$apache_install_dir/bin/apxs \
    --prefix=$php_install_dir \
    --enable-ftp --enable-sockets \
    --enable-sysvmsg --enable-sysvshm --enable-sysvsem \
    --enable-sigchild --enable-mbstring --enable-bcmath \
    --with-oci8 --with-zlib \
    --without-openssl --without-libxml \
    --without-sqlite3 --without-pdo-sqlite --without-mysqli \
    --disable-xml --disable-simplexml \
    --disable-xmlreader --disable-xmlwriter \
    --disable-phar --disable-dom \
    --with-external-pcre=$pcre_tmp_installation_dir \
    --disable-opcache --without-pcre-jit

As mentioned previously, the CLI version of php successfully runs. The "ldd" output from both the CLI executable and libphp.so is identical:

        librt.so.1 =>    /lib/64/librt.so.1
        libm.so.2 =>     /lib/64/libm.so.2
        libz.so.1 =>     /u/local/lib64/zlib-1.2.11/lib/libz.so.1
        libkstat.so.1 =>         /lib/64/libkstat.so.1
        libnsl.so.1 =>   /lib/64/libnsl.so.1
        libsocket.so.1 =>        /lib/64/libsocket.so.1
        libresolv.so.2 =>        /lib/64/libresolv.so.2
        libgen.so.1 =>   /lib/64/libgen.so.1
        libdl.so.1 =>    /lib/64/libdl.so.1
        libsched.so.1 =>         /usr/lib/64/libsched.so.1
        libaio.so.1 =>   /lib/64/libaio.so.1
        libpool.so.1 =>  /usr/lib/64/libpool.so.1
        libadm.so.1 =>   /lib/64/libadm.so.1
        libefi.so.1 =>   /lib/64/libefi.so.1
        libproject.so.1 =>       /usr/lib/64/libproject.so.1
        libucrypto.so.1 =>       /lib/64/libucrypto.so.1
        libclntsh.so.19.1 =>     /u01/app/oracle/product/19.0.0/client_1/lib64/libclntsh.so.19.1
        libc.so.1 =>     /lib/64/libc.so.1
        libxml2.so.2 =>  /lib/64/libxml2.so.2
        libscf.so.1 =>   /lib/64/libscf.so.1
        libnvpair.so.1 =>        /lib/64/libnvpair.so.1
        libexacct.so.1 =>        /usr/lib/64/libexacct.so.1
        libcmdutils.so.1 =>      /lib/64/libcmdutils.so.1
        libavl.so.1 =>   /lib/64/libavl.so.1
        libidlist.so.1 =>        /lib/64/libidlist.so.1
        libuuid.so.1 =>  /lib/64/libuuid.so.1
        libproc.so.1 =>  /lib/64/libproc.so.1
        libelf.so.1 =>   /lib/64/libelf.so.1
        libcryptoutil.so.1 =>    /lib/64/libcryptoutil.so.1
        libbsm.so.1 =>   /lib/64/libbsm.so.1
        libnnz19.so =>   /u01/app/oracle/product/19.0.0/client_64/lib/libnnz19.so
        libclntshcore.so.19.1 =>         /u01/app/oracle/product/19.0.0/client_64/lib/libclntshcore.so.19.1
        libz.so.1 =>     /lib/64/libz.so.1
        libuutil.so.1 =>         /lib/64/libuutil.so.1
        libv12n.so.1 =>  /usr/lib/64/libv12n.so.1
        libcontract.so.1 =>      /lib/64/libcontract.so.1
        libinetutil.so.1 =>      /lib/64/libinetutil.so.1
        liblgrp.so.1 =>  /usr/lib/64/liblgrp.so.1
        librtld_db.so.1 =>       /lib/64/librtld_db.so.1
        libctf.so.1 =>   /lib/64/libctf.so.1
        libsdwarf.so.1 =>        /usr/lib/64/libsdwarf.so.1
        libtsol.so.2 =>  /lib/64/libtsol.so.2

I ran "httpd -t" using truss(1); it starts loading the PHP module's dependencies around line 4460 in "php-lib-truss.txt" (Unix-format text file). Nothing looks out of line until about line 4809: After it loads libcryptoutil.so.1, it attempts to open /etc/system.d/crypto:fips-140, receives an ENOENT, closes a file descriptor, prints the "Can't load API module" message, and starts to shut down.

This initially led me to believe that there was a problem with libcryptoutil's initialization. scripts/php-config showed a very long list of libraries, including libsoftcrypto, which is dependent on libcryptoutil. I was uncertain where the "-lsoftcrupto" came from, but found that configure inspects $ORACLE_HOME/lib/sysliblist, and the "mystery" libraries were listed there.

I hacked configure to not inspect Oracle's sysliblist, but the resulting cli executable and Apache module still had the same ldd module as before me trying to ignore sysliblist.

I also ran the cli executable under truss (php-cli-truss.txt; again, Unix format), and I saw that the loading of shared libraries was largely the same as with the Apache module (with some differences). The cli executable, I found, also loads libcryptoutil and tries to open /etc/system.d/crypto:fips-140 as well, but the cli executable just continues with its initialization and works as expected.

So, we're looking for guidance as to how to get PHP 8.1.27's Apache module to load under Solaris 11.

php-lib-truss.txt
php-cli-truss.txt

PHP Version

PHP 8.1.27

Operating System

Solaris 11/SPARC

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions