# php72 (with ZTS) and php72-extensions



## ssbear (Jun 3, 2018)

Hi everyone.

I installed lang/php72 and lang/php72-extensions.
However, when I launch `apache24`, I got those issues in my /var/log/httpd-error.log :


```
[Sun Jun 03 19:30:31.572114 2018] [mpm_prefork:notice] [pid 78051] AH00169: caught SIGTERM, shutting down
[Sun Jun 03 19:30:31.680790 2018] [ssl:warn] [pid 78308] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sun Jun 03 19:30:31.700554 2018] [ssl:warn] [pid 78309] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
PHP Warning:  Failed loading Zend extension 'opcache.so' (tried: /usr/local/lib/php/20170718/opcache.so (Cannot open "/usr/local/lib/php/20170718/opcache.so"), /usr/local/lib/php/20170718/opcache.so.so (Cannot open "/usr/local/lib/php/20170718/opcache.so.so")) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'session.so' (tried: /usr/local/lib/php/20170718/session.so (Cannot open &quot;/usr/local/lib/php/20170718/session.so&quot;), /usr/local/lib/php/20170718/session.so.so (Cannot open &quot;/usr/local/lib/php/20170718/session.so.so&quot;)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'bz2.so' (tried: /usr/local/lib/php/20170718/bz2.so (Cannot open &quot;/usr/local/lib/php/20170718/bz2.so&quot;), /usr/local/lib/php/20170718/bz2.so.so (Cannot open &quot;/usr/local/lib/php/20170718/bz2.so.so&quot;)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'ctype.so' (tried: /usr/local/lib/php/20170718/ctype.so (Cannot open &quot;/usr/local/lib/php/20170718/ctype.so&quot;), /usr/local/lib/php/20170718/ctype.so.so (Cannot open &quot;/usr/local/lib/php/20170718/ctype.so.so&quot;)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'curl.so' (tried: /usr/local/lib/php/20170718/curl.so (Cannot open &quot;/usr/local/lib/php/20170718/curl.so&quot;), /usr/local/lib/php/20170718/curl.so.so (Cannot open &quot;/usr/local/lib/php/20170718/curl.so.so&quot;)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'dom.so' (tried: /usr/local/lib/php/20170718/dom.so (Cannot open &quot;/usr/local/lib/php/20170718/dom.so&quot;), /usr/local/lib/php/20170718/dom.so.so (Cannot open &quot;/usr/local/lib/php/20170718/dom.so.so&quot;)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'exif.so' (tried: /usr/local/lib/php/20170718/exif.so (Cannot open &quot;/usr/local/lib/php/20170718/exif.so&quot;), /usr/local/lib/php/20170718/exif.so.so (Cannot open &quot;/usr/local/lib/php/20170718/exif.so.so&quot;)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'filter.so' (tried: /usr/local/lib/php/20170718/filter.so (Cannot open &quot;/usr/local/lib/php/20170718/filter.so&quot;), /usr/local/lib/php/20170718/filter.so.so (Cannot open &quot;/usr/local/lib/php/20170718/filter.so.so&quot;)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'gd.so' (tried: /usr/local/lib/php/20170718/gd.so (Cannot open &quot;/usr/local/lib/php/20170718/gd.so&quot;), /usr/local/lib/php/20170718/gd.so.so (Cannot open &quot;/usr/local/lib/php/20170718/gd.so.so&quot;)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'hash.so' (tried: /usr/local/lib/php/20170718/hash.so (Cannot open &quot;/usr/local/lib/php/20170718/hash.so&quot;), /usr/local/lib/php/20170718/hash.so.so (Cannot open &quot;/usr/local/lib/php/20170718/hash.so.so&quot;)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'iconv.so' (tried: /usr/local/lib/php/20170718/iconv.so (Cannot open &quot;/usr/local/lib/php/20170718/iconv.so&quot;), /usr/local/lib/php/20170718/iconv.so.so (Cannot open &quot;/usr/local/lib/php/20170718/iconv.so.so&quot;)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'json.so' (tried: /usr/local/lib/php/20170718/json.so (Cannot open &quot;/usr/local/lib/php/20170718/json.so&quot;), /usr/local/lib/php/20170718/json.so.so (Cannot open &quot;/usr/local/lib/php/20170718/json.so.so&quot;)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'mbstring.so' (tried: /usr/local/lib/php/20170718/mbstring.so (Cannot open &quot;/usr/local/lib/php/20170718/mbstring.so&quot;), /usr/local/lib/php/20170718/mbstring.so.so (Cannot open &quot;/usr/local/lib/php/20170718/mbstring.so.so&quot;)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'mysqli.so' (tried: /usr/local/lib/php/20170718/mysqli.so (Cannot open &quot;/usr/local/lib/php/20170718/mysqli.so&quot;), /usr/local/lib/php/20170718/mysqli.so.so (Cannot open &quot;/usr/local/lib/php/20170718/mysqli.so.so&quot;)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'openssl.so' (tried: /usr/local/lib/php/20170718/openssl.so (Cannot open &quot;/usr/local/lib/php/20170718/openssl.so&quot;), /usr/local/lib/php/20170718/openssl.so.so (Cannot open &quot;/usr/local/lib/php/20170718/openssl.so.so&quot;)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'pdo.so' (tried: /usr/local/lib/php/20170718/pdo.so (Cannot open &quot;/usr/local/lib/php/20170718/pdo.so&quot;), /usr/local/lib/php/20170718/pdo.so.so (Cannot open &quot;/usr/local/lib/php/20170718/pdo.so.so&quot;)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'posix.so' (tried: /usr/local/lib/php/20170718/posix.so (Cannot open &quot;/usr/local/lib/php/20170718/posix.so&quot;), /usr/local/lib/php/20170718/posix.so.so (Cannot open &quot;/usr/local/lib/php/20170718/posix.so.so&quot;)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'simplexml.so' (tried: /usr/local/lib/php/20170718/simplexml.so (Cannot open &quot;/usr/local/lib/php/20170718/simplexml.so&quot;), /usr/local/lib/php/20170718/simplexml.so.so (Cannot open &quot;/usr/local/lib/php/20170718/simplexml.so.so&quot;)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'sqlite3.so' (tried: /usr/local/lib/php/20170718/sqlite3.so (Cannot open &quot;/usr/local/lib/php/20170718/sqlite3.so&quot;), /usr/local/lib/php/20170718/sqlite3.so.so (Cannot open &quot;/usr/local/lib/php/20170718/sqlite3.so.so&quot;)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'tokenizer.so' (tried: /usr/local/lib/php/20170718/tokenizer.so (Cannot open &quot;/usr/local/lib/php/20170718/tokenizer.so&quot;), /usr/local/lib/php/20170718/tokenizer.so.so (Cannot open &quot;/usr/local/lib/php/20170718/tokenizer.so.so&quot;)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'xml.so' (tried: /usr/local/lib/php/20170718/xml.so (Cannot open &quot;/usr/local/lib/php/20170718/xml.so&quot;), /usr/local/lib/php/20170718/xml.so.so (Cannot open &quot;/usr/local/lib/php/20170718/xml.so.so&quot;)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'xmlwriter.so' (tried: /usr/local/lib/php/20170718/xmlwriter.so (Cannot open &quot;/usr/local/lib/php/20170718/xmlwriter.so&quot;), /usr/local/lib/php/20170718/xmlwriter.so.so (Cannot open &quot;/usr/local/lib/php/20170718/xmlwriter.so.so&quot;)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'zip.so' (tried: /usr/local/lib/php/20170718/zip.so (Cannot open &quot;/usr/local/lib/php/20170718/zip.so&quot;), /usr/local/lib/php/20170718/zip.so.so (Cannot open &quot;/usr/local/lib/php/20170718/zip.so.so&quot;)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'zlib.so' (tried: /usr/local/lib/php/20170718/zlib.so (Cannot open &quot;/usr/local/lib/php/20170718/zlib.so&quot;), /usr/local/lib/php/20170718/zlib.so.so (Cannot open &quot;/usr/local/lib/php/20170718/zlib.so.so&quot;)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'pdf.so' (tried: /usr/local/lib/php/20170718/pdf.so (Cannot open &quot;/usr/local/lib/php/20170718/pdf.so&quot;), /usr/local/lib/php/20170718/pdf.so.so (Cannot open &quot;/usr/local/lib/php/20170718/pdf.so.so&quot;)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'pdo_mysql.so' (tried: /usr/local/lib/php/20170718/pdo_mysql.so (Cannot open &quot;/usr/local/lib/php/20170718/pdo_mysql.so&quot;), /usr/local/lib/php/20170718/pdo_mysql.so.so (Cannot open &quot;/usr/local/lib/php/20170718/pdo_mysql.so.so&quot;)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'pdo_sqlite.so' (tried: /usr/local/lib/php/20170718/pdo_sqlite.so (Cannot open &quot;/usr/local/lib/php/20170718/pdo_sqlite.so&quot;), /usr/local/lib/php/20170718/pdo_sqlite.so.so (Cannot open &quot;/usr/local/lib/php/20170718/pdo_sqlite.so.so&quot;)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'phar.so' (tried: /usr/local/lib/php/20170718/phar.so (Cannot open &quot;/usr/local/lib/php/20170718/phar.so&quot;), /usr/local/lib/php/20170718/phar.so.so (Cannot open &quot;/usr/local/lib/php/20170718/phar.so.so&quot;)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'xmlreader.so' (tried: /usr/local/lib/php/20170718/xmlreader.so (Cannot open &quot;/usr/local/lib/php/20170718/xmlreader.so&quot;), /usr/local/lib/php/20170718/xmlreader.so.so (Cannot open &quot;/usr/local/lib/php/20170718/xmlreader.so.so&quot;)) in Unknown on line 0
[Sun Jun 03 19:30:31.705465 2018] [mpm_prefork:notice] [pid 78309] AH00163: Apache/2.4.33 (FreeBSD) OpenSSL/1.0.2k-freebsd PHP/7.2.6 mpm-itk/2.4.7-04 configured -- resuming normal operations
[Sun Jun 03 19:30:31.705531 2018] [core:notice] [pid 78309] AH00094: Command line: '/usr/local/sbin/httpd -D SSL -D NOHTTPACCEPT'
```

Indeed, as I compiled php72 with zts option, all my extensions are in /usr/local/lib/php/20170718-zts, and not in /usr/local/lib/php/20170718.

I got no trace about zts in a phpinfo() (and Thread Safety is Off). However, on my previous machine (with lang/php56), I can see :

```
'./configure' '--with-layout=GNU' '--localstatedir=/var' '--with-config-file-scan-dir=/usr/local/etc/php' '--disable-all' '--enable-libxml' '--enable-mysqlnd' '--with-libxml-dir=/usr/local' '--with-pcre-regex=/usr/local' '--with-zlib-dir=/usr' '--program-prefix=' '--disable-cli' '--disable-cgi' '--with-apxs2=/usr/local/sbin/apxs' '--with-regex=php' '--with-zend-vm=CALL' '--enable-maintainer-zts' '--prefix=/usr/local' '--mandir=/usr/local/man' '--infodir=/usr/local/info/' '--build=amd64-portbld-freebsd10.3' 'build_alias=amd64-portbld-freebsd10.3' 'CC=cc' 'CFLAGS=-O2 '-pipe' '-fstack-protector' '-fno-strict-aliasing'' 'LDFLAGS= '-fstack-protector'' 'LIBS=-lpthread' 'CPPFLAGS=' 'CPP=cpp' 'CXX=c++' 'CXXFLAGS=-O2 '-pipe' '-fstack-protector' '-fno-strict-aliasing'
```

What I guess: my extensions are compiled with zts, and not my php.
Do you have any idea regarding this issue? Why php is not looking in the right directory? Why php wasn't compiled with zts?
Thanks a lot for your ideas and advices.

Regards,


----------



## ssbear (Jun 3, 2018)

Solved: I had to compile www/mod_php72 with zts option...
lang/php72 was compiled with zts, but using php with Apache, the issue wasn't on this side


----------

