Solved PHP Startup: Unable to load dynamic library

Hello guys! Anyone know how to fix these errors? When I run a script with session_start() I get these errors in httpd_error.log and the page doesn't work. I already reinstalled lang/php55 clean. I don't know what to do.
Code:
Failed loading /usr/local/lib/php/20121212-zts-debug/opcache.so:  /usr/local/lib/php/20121212-zts-debug/opcache.so: Undefined symbol "core_globals_id"
Failed loading /usr/local/lib/php/20121212-zts-debug/opcache.so:  /usr/local/lib/php/20121212-zts-debug/opcache.so: Undefined symbol "core_globals_id"
Failed loading /usr/local/lib/php/20121212-zts-debug/opcache.so:  /usr/local/lib/php/20121212-zts-debug/opcache.so: Undefined symbol "core_globals_id"
Failed loading /usr/local/lib/php/20121212-zts-debug/opcache.so:  /usr/local/lib/php/20121212-zts-debug/opcache.so: Undefined symbol "core_globals_id"
Failed loading /usr/local/lib/php/20121212-zts-debug/opcache.so:  /usr/local/lib/php/20121212-zts-debug/opcache.so: Undefined symbol "core_globals_id"
[Fri Dec 18 20:31:16.349430 2015] [mpm_prefork:notice] [pid 52078] AH00169: caught SIGTERM, shutting down
Failed loading /usr/local/lib/php/20121212-zts-debug/opcache.so:  /usr/local/lib/php/20121212-zts-debug/opcache.so: Undefined symbol "core_globals_id"
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20121212/ctype.so' - Cannot open "/usr/local/lib/php/20121212/ctype.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20121212/dom.so' - Cannot open "/usr/local/lib/php/20121212/dom.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20121212/filter.so' - Cannot open "/usr/local/lib/php/20121212/filter.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20121212/hash.so' - Cannot open "/usr/local/lib/php/20121212/hash.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20121212/iconv.so' - Cannot open "/usr/local/lib/php/20121212/iconv.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20121212/interbase.so' - Cannot open "/usr/local/lib/php/20121212/interbase.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20121212/mysql.so' - Cannot open "/usr/local/lib/php/20121212/mysql.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20121212/mysqli.so' - Cannot open "/usr/local/lib/php/20121212/mysqli.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20121212/openssl.so' - Cannot open "/usr/local/lib/php/20121212/openssl.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20121212/pdo.so' - Cannot open "/usr/local/lib/php/20121212/pdo.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20121212/pdo_sqlite.so' - Cannot open "/usr/local/lib/php/20121212/pdo_sqlite.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20121212/phar.so' - Cannot open "/usr/local/lib/php/20121212/phar.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20121212/posix.so' - Cannot open "/usr/local/lib/php/20121212/posix.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20121212/session.so' - Cannot open "/usr/local/lib/php/20121212/session.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20121212/simplexml.so' - Cannot open "/usr/local/lib/php/20121212/simplexml.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20121212/sqlite3.so' - Cannot open "/usr/local/lib/php/20121212/sqlite3.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20121212/tokenizer.so' - Cannot open "/usr/local/lib/php/20121212/tokenizer.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20121212/xml.so' - Cannot open "/usr/local/lib/php/20121212/xml.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20121212/xmlreader.so' - Cannot open "/usr/local/lib/php/20121212/xmlreader.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20121212/xmlwriter.so' - Cannot open "/usr/local/lib/php/20121212/xmlwriter.so" in Unknown on line 0
[Fri Dec 18 20:31:16.680247 2015] [mpm_prefork:notice] [pid 52105] AH00163: Apache/2.4.18 (FreeBSD) PHP/5.5.30 configured -- resuming normal operations
[Fri Dec 18 20:31:16.680469 2015] [core:notice] [pid 52105] AH00094: Command line: '/usr/local/sbin/httpd -D NOHTTPACCEPT'
 
Last edited by a moderator:
Fixed all problems by a newbie...(me)...
Thanks for no response.
An moderator can Topic Close? (TC)
 
Last edited by a moderator:
From the looks of things there is a mix and match of PHP compiled with the ZTS option set to on and not. How exactly did you fix it for future folks looking at this thread? And for future reference you can also set solved yourself ("Thread tools" at the top right, "edit thread", add "solved" tag).
 
Just a reminder that php 5.5 has reached its end-of-life (summer 2016) and no further updates will be issued. I suggest you to upgrade to 5.6 or later.
 
FWIW
I stumbled on this thinking that I was upgrading lang/php5, when in fact the whole thing was actually a downgrade.
The problem; The resolution:
In my case (and likely any case with this error), the problem is I'm also installing the www/mod_php module, along with the CLI, and a number of extensions. Since I've installed Apache MPM (threaded apache), PHP insists it should install Threaded-ZTS (the zend opcache). BUT, the threaded opcache doesn't work that well on php5 version 55 (I've not tried it on 56).
The Solution:
Either recompile Apache as PreFork, and go about your merry way.
or
Upgrade your lang/php5 from 5(56) to 53/(54?), and go about your merry way.
While I'm about to try it, I can't (yet) say that it'll work. But I'm going to take a shot at rebuilding lang/php5 with the ZTS option disabled, and see if it'll work.
NOTE:
There is one other possibility that can cause this error;
"symbol clash/collision"; That being the mixture of two different versions. ie; say php53 using a library from some other version of PHP. It's (symbol clash) not limited to PHP. But since that's the topic...

UPDATE:
OK, I deinstalled, and rebuilt lang/php55, and lang/php55-extensions (which by default included www/mod_php).
Then rebuilt lang/php55 with option OPTIONS_FILE_UNSET+=ZTS
This resulted in everything working as one would/should expect. No errors.
Do note: that doing so on a ApacheMPM install will cause the ports framework to throw a warning; indicating that you have a Threaded Apache, and MUST install with Threaded-ZTS.
You can ignore it. :)

HTH

--Chris
 
But I'm going to take a shot at rebuilding lang/php5 with the ZTS option disabled, and see if it'll work.
You really need to update your ports tree, lang/php5 was removed from the ports tree almost 2 years ago. PHP 5.5 has also been deprecated since then (port was removed 13 months ago).
 
Hey, SirDice ! What business is it of yours what version(s) I use on my machines. ;);):)
Seriously tho. I'm still "tweaking" a box into my final desired setup, before pushing it up to RELENG_11.
So yea. You're right. I'm just not there yet. What's more; now there's an answer posted, for anyone that runs into a similar situation. :)

--Chris out...
 
I got a similiar issue, but for portmaster lang/php7.4, but for bz2 ctype dom filter gd iconv json mbstring mysqli opcache openssl pdo pdo_mysql pdo_sqlite phar posix session simplexml sqlite3 tokenizer xml xmlreader xmlwriter zip zlib

I'm not sure, how to solve it. Maybe this happens, because I didn't remove the installed packages, installed by `pkg install` beforehand (I'm new to FreeBSD) and they are conflicting with the ports installation with portsmaster?

Edit:

Okay, I just tried to remove all the pkg installed php74 packages and issued `portmaster lang/php74` again. It finished faster then the first time.

Code:
root@FAMP:~ # pkg remove php74 php74-bz2 php74-ctype php74-dom php74-extensions php74-filter php74-gd php74-iconv php74-json php74-mbstring php74-mysqli php74-opcache php74-openssl php74-pdo php74-pdo_sqlite php74-phar php74-posix php74-session php74-simplexml php74-sqlite3 php74-tokenizer php74-xml php74-xmlreader php74-xmlwriter php74-zip php74-zlib phpMyAdmin-php74
Updating database digests format: 100%
Checking integrity... done (0 conflicting)
Deinstallation has been requested for the following 31 packages (of 0 packages in the universe):

Installed packages to be REMOVED:
        php74: 7.4.9
        php74-bz2: 7.4.9
        php74-ctype: 7.4.9
        php74-dom: 7.4.9
        php74-extensions: 1.0
        php74-filter: 7.4.9
        php74-gd: 7.4.9
        php74-iconv: 7.4.9
        php74-json: 7.4.9
        php74-mbstring: 7.4.9
        php74-mysqli: 7.4.9
        php74-opcache: 7.4.9
        php74-openssl: 7.4.9
        php74-pdo: 7.4.9
        php74-pdo_mysql: 7.4.9
        php74-pdo_sqlite: 7.4.9
        php74-pear: 1.10.6
        php74-pear-MDB2: 2.5.0.b5
        php74-pear-MDB2_Driver_mysqli: 1.5.0.b4
        php74-phar: 7.4.9
        php74-posix: 7.4.9
        php74-session: 7.4.9
        php74-simplexml: 7.4.9
        php74-sqlite3: 7.4.9
        php74-tokenizer: 7.4.9
        php74-xml: 7.4.9
        php74-xmlreader: 7.4.9
        php74-xmlwriter: 7.4.9
        php74-zip: 7.4.9
        php74-zlib: 7.4.9
        phpMyAdmin-php74: 4.9.5

Number of packages to be removed: 31

The operation will free 123 MiB.

[...]

Warning: Invalid argument supplied for foreach() in /usr/local/share/pear/PEAR/Command.php on line 249
XML Extension not found
[FAMP] [3/31] Deleting files for php74-pear-MDB2-2.5.0.b5: 100%
[FAMP] [4/31] Deinstalling php74-pdo_sqlite-7.4.9...
[FAMP] [4/31] Deleting files for php74-pdo_sqlite-7.4.9: 100%
[FAMP] [5/31] Deinstalling phpMyAdmin-php74-4.9.5...
You may need to manually remove /usr/local/www/phpMyAdmin/config.inc.php if it is no longer needed.
[FA[MP] [5/31] Deleting files for phpMyAdmin-php74-4.9.5: 100%
[FAMP] [6/31] Deinstalling php74-pdo_mysql-7.4.9...
[FAMP] [6/31] Deleting files for php74-pdo_mysql-7.4.9: 100%
[FAMP] [7/31] Deinstalling php74-pear-1.10.6...
[FAMP] [7/31] Deleting files for php74-pear-1.10.6: 100%
[FAMP] [8/31] Deinstalling php74-bz2-7.4.9...
[FAMP] [8/31] Deleting files for php74-bz2-7.4.9: 100%
[FAMP] [9/31] Deinstalling php74-ctype-7.4.9...
[FAMP] [9/31] Deleting files for php74-ctype-7.4.9: 100%
[FAMP] [10/31] Deinstalling php74-dom-7.4.9...
[FAMP] [10/31] Deleting files for php74-dom-7.4.9: 100%
[FAMP] [11/31] Deinstalling php74-filter-7.4.9...
[FAMP] [11/31] Deleting files for php74-filter-7.4.9: 100%
[FAMP] [12/31] Deinstalling php74-gd-7.4.9...
[FAMP] [12/31] Deleting files for php74-gd-7.4.9: 100%
[FAMP] [13/31] Deinstalling php74-iconv-7.4.9...
[FAMP] [13/31] Deleting files for php74-iconv-7.4.9: 100%
[FAMP] [14/31] Deinstalling php74-json-7.4.9...
[FAMP] [14/31] Deleting files for php74-json-7.4.9: 100%
[FAMP] [15/31] Deinstalling php74-mbstring-7.4.9...
[FAMP] [15/31] Deleting files for php74-mbstring-7.4.9: 100%
[FAMP] [16/31] Deinstalling php74-mysqli-7.4.9...
[FAMP] [16/31] Deleting files for php74-mysqli-7.4.9: 100%
[FAMP] [17/31] Deinstalling php74-opcache-7.4.9...
[FAMP] [17/31] Deleting files for php74-opcache-7.4.9: 100%
[FAMP] [18/31] Deinstalling php74-openssl-7.4.9...
[FAMP] [18/31] Deleting files for php74-openssl-7.4.9: 100%
[FAMP] [19/31] Deinstalling php74-pdo-7.4.9...
[FAMP] [19/31] Deleting files for php74-pdo-7.4.9: 100%
[FAMP] [20/31] Deinstalling php74-phar-7.4.9...
[FAMP] [20/31] Deleting files for php74-phar-7.4.9: 100%
[FAMP] [21/31] Deinstalling php74-posix-7.4.9...
[FAMP] [21/31] Deleting files for php74-posix-7.4.9: 100%
[FAMP] [22/31] Deinstalling php74-session-7.4.9...
[FAMP] [22/31] Deleting files for php74-session-7.4.9: 100%
[FAMP] [23/31] Deinstalling php74-simplexml-7.4.9...
[FAMP] [23/31] Deleting files for php74-simplexml-7.4.9: 100%
[FAMP] [24/31] Deinstalling php74-sqlite3-7.4.9...
[FAMP] [24/31] Deleting files for php74-sqlite3-7.4.9: 100%
[FAMP] [25/31] Deinstalling php74-tokenizer-7.4.9...
[FAMP] [25/31] Deleting files for php74-tokenizer-7.4.9: 100%
[FAMP] [26/31] Deinstalling php74-xml-7.4.9...
[FAMP] [26/31] Deleting files for php74-xml-7.4.9: 100%
[FAMP] [27/31] Deinstalling php74-xmlreader-7.4.9...
[FAMP] [27/31] Deleting files for php74-xmlreader-7.4.9: 100%
[FAMP] [28/31] Deinstalling php74-xmlwriter-7.4.9...
[FAMP] [28/31] Deleting files for php74-xmlwriter-7.4.9: 100%
[FAMP] [29/31] Deinstalling php74-zip-7.4.9...
[FAMP] [29/31] Deleting files for php74-zip-7.4.9: 100%
[FAMP] [30/31] Deinstalling php74-zlib-7.4.9...
[FAMP] [30/31] Deleting files for php74-zlib-7.4.9: 100%
[FAMP] [31/31] Deinstalling php74-7.4.9...
[FAMP] [31/31] Deleting files for php74-7.4.9: 100%

(Complete: https://pastebin.pl/view/39955b3b)

This time php-fpm only warns, that nd_mysql isn't loading (BTW that's the thing I'll need for wordpress, and the reaso why I tried to install php74 by portmaster instead of pkg install, because there is no package, i.e. the php74 comes without nd_mysql enabled https://wordpress.org/support/topic...ined-function-mysql_connect-in/#post-12735487).

Code:
root@FAMP:~ # portmaster lang/php74

===>>> Port directory: /usr/ports/lang/php74

===>>> Gathering distinfo list for installed ports

===>>> Launching 'make checksum' for lang/php74 in background
===>>> Gathering dependency list for lang/php74 from ports
===>>> Initial dependency check complete for lang/php74


===>>> Starting build for lang/php74 <<<===

===>>> All dependencies are up to date

===>  Cleaning for php74-7.4.9
===>  License PHP301 accepted by the user
===>   php74-7.4.9 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by php74-7.4.9 for building
===>  Extracting for php74-7.4.9
=> SHA256 Checksum OK for php-7.4.9.tar.xz.
===>  Patching for php74-7.4.9
===>  Applying FreeBSD patches for php74-7.4.9 from /usr/ports/lang/php74/files
===>   php74-7.4.9 depends on package: pkgconf>=1.3.0_1 - found
===>   php74-7.4.9 depends on package: autoconf>=2.69 - found
===>   php74-7.4.9 depends on package: automake>=1.16.1 - found
===>   php74-7.4.9 depends on shared library: libpcre2-8.so - found (/usr/local/lib/libpcre2-8.so)
===>   php74-7.4.9 depends on shared library: libargon2.so - found (/usr/local/lib/libargon2.so)
===>   php74-7.4.9 depends on shared library: libxml2.so - found (/usr/local/lib/libxml2.so)
===>  Configuring for php74-7.4.9
buildconf: Checking installation
buildconf: autoconf version 2.69 (ok)
buildconf: Forcing buildconf. The configure files will be regenerated.
buildconf: Cleaning cache and configure files
buildconf: Rebuilding configure

[...]

-lcrypt  -o sapi/cgi/php-cgi
--- all ---
Build complete.
Don't forget to run 'make test'.
===>>> Building the port required 163 seconds
===>  Staging for php74-7.4.9
===>   Generating temporary packing list
Installing PHP SAPI module:       embed
Installing PHP CLI binary:        /usr/ports/lang/php74/work/stage/usr/local/bin/
Installing PHP CLI man page:      /usr/ports/lang/php74/work/stage/usr/local/man/man1/
Installing PHP FPM binary:        /usr/ports/lang/php74/work/stage/usr/local/sbin/
Installing PHP FPM defconfig:     /usr/ports/lang/php74/work/stage/usr/local/etc/
Installing PHP FPM man page:      /usr/ports/lang/php74/work/stage/usr/local/man/man8/
Installing PHP FPM status page:   /usr/ports/lang/php74/work/stage/usr/local/share/php/fpm/
Installing phpdbg binary:         /usr/ports/lang/php74/work/stage/usr/local/bin/
Installing phpdbg man page:       /usr/ports/lang/php74/work/stage/usr/local/man/man1/
Installing PHP CGI binary:        /usr/ports/lang/php74/work/stage/usr/local/bin/
Installing PHP CGI man page:      /usr/ports/lang/php74/work/stage/usr/local/man/man1/
Installing build environment:     /usr/ports/lang/php74/work/stage/usr/local/lib/php/build/
Installing header files:          /usr/ports/lang/php74/work/stage/usr/local/include/php/
Installing helper programs:       /usr/ports/lang/php74/work/stage/usr/local/bin/
  program: phpize
  program: php-config
Installing man pages:             /usr/ports/lang/php74/work/stage/usr/local/man/man1/
  page: phpize.1
  page: php-config.1
install  -m 0644 /usr/ports/lang/php74/work/php-7.4.9/php.ini-development /usr/ports/lang/php74/work/php-7.4.9/php.ini-production  /usr/ports/lang/php74/work/php.conf /usr/ports/lang/php74/work/stage//usr/local/etc
====> Compressing man pages (compress-man)
===> Staging rc.d startup script(s)
===>  Installing for php74-7.4.9
===>  Checking if php74 is already installed
===>   Registering installation for php74-7.4.9
[FAMP] Installing php74-7.4.9...
===> SECURITY REPORT:
      This port has installed the following files which may act as network
      servers and may therefore pose a remote security risk to the system.
/usr/local/bin/php
/usr/local/bin/php-cgi
/usr/local/sbin/php-fpm
/usr/local/bin/phpdbg
/usr/local/lib/libphp7.so

      If there are vulnerabilities in these programs there may be a security
      risk to the system. FreeBSD makes no guarantee about the security of
      ports included in the Ports Collection. Please type 'make deinstall'
      to deinstall the port if this is a concern.

      For more information, and contact details about the security
      status of this software, see the following webpage:
https://www.php.net/

===>>> Installation of lang/php74 (php74-7.4.9) complete

root@FAMP:~ # /usr/local/etc/rc.d/php-fpm onerestart
Performing sanity check on php-fpm configuration:
[29-Aug-2020 21:20:48] NOTICE: PHP message: PHP Warning:  PHP Startup: Unable to load dynamic library 'nd_mysql' (tried: /usr/local/lib/php/20190902-zts-debug/nd_mysql (Cannot open &quot;/usr/local/lib/php/20190902-zts-debug/nd_mysql&quot;), /usr/local/lib/php/20190902-zts-debug/nd_mysql.so (Cannot open &quot;/usr/local/lib/php/20190902-zts-debug/nd_mysql.so&quot;)) in Unknown on line 0
<br />
<b>Warning</b>:  PHP Startup: Unable to load dynamic library 'nd_mysql' (tried: /usr/local/lib/php/20190902-zts-debug/nd_mysql (Cannot open &quot;/usr/local/lib/php/20190902-zts-debug/nd_mysql&quot;), /usr/local/lib/php/20190902-zts-debug/nd_mysql.so (Cannot open &quot;/usr/local/lib/php/20190902-zts-debug/nd_mysql.so&quot;)) in <b>Unknown</b> on line <b>0</b><br />
Unknown(0) : Warning - PHP Startup: Unable to load dynamic library 'nd_mysql' (tried: /usr/local/lib/php/20190902-zts-debug/nd_mysql (Cannot open &quot;/usr/local/lib/php/20190902-zts-debug/nd_mysql&quot;), /usr/local/lib/php/20190902-zts-debug/nd_mysql.so (Cannot open &quot;/usr/local/lib/php/20190902-zts-debug/nd_mysql.so&quot;))
[29-Aug-2020 21:20:48] NOTICE: configuration file /usr/local/etc/php-fpm.conf test is successful

Stopping php_fpm.
Waiting for PIDS: 81472.
Performing sanity check on php-fpm configuration:
[29-Aug-2020 21:20:48] NOTICE: PHP message: PHP Warning:  PHP Startup: Unable to load dynamic library 'nd_mysql' (tried: /usr/local/lib/php/20190902-zts-debug/nd_mysql (Cannot open &quot;/usr/local/lib/php/20190902-zts-debug/nd_mysql&quot;), /usr/local/lib/php/20190902-zts-debug/nd_mysql.so (Cannot open &quot;/usr/local/lib/php/20190902-zts-debug/nd_mysql.so&quot;)) in Unknown on line 0
<br />
<b>Warning</b>:  PHP Startup: Unable to load dynamic library 'nd_mysql' (tried: /usr/local/lib/php/20190902-zts-debug/nd_mysql (Cannot open &quot;/usr/local/lib/php/20190902-zts-debug/nd_mysql&quot;), /usr/local/lib/php/20190902-zts-debug/nd_mysql.so (Cannot open &quot;/usr/local/lib/php/20190902-zts-debug/nd_mysql.so&quot;)) in <b>Unknown</b> on line <b>0</b><br />
Unknown(0) : Warning - PHP Startup: Unable to load dynamic library 'nd_mysql' (tried: /usr/local/lib/php/20190902-zts-debug/nd_mysql (Cannot open &quot;/usr/local/lib/php/20190902-zts-debug/nd_mysql&quot;), /usr/local/lib/php/20190902-zts-debug/nd_mysql.so (Cannot open &quot;/usr/local/lib/php/20190902-zts-debug/nd_mysql.so&quot;))
[29-Aug-2020 21:20:48] NOTICE: configuration file /usr/local/etc/php-fpm.conf test is successful

Starting php_fpm.
[29-Aug-2020 21:20:48] NOTICE: PHP message: PHP Warning:  PHP Startup: Unable to load dynamic library 'nd_mysql' (tried: /usr/local/lib/php/20190902-zts-debug/nd_mysql (Cannot open &quot;/usr/local/lib/php/20190902-zts-debug/nd_mysql&quot;), /usr/local/lib/php/20190902-zts-debug/nd_mysql.so (Cannot open &quot;/usr/local/lib/php/20190902-zts-debug/nd_mysql.so&quot;)) in Unknown on line 0
<br />
<b>Warning</b>:  PHP Startup: Unable to load dynamic library 'nd_mysql' (tried: /usr/local/lib/php/20190902-zts-debug/nd_mysql (Cannot open &quot;/usr/local/lib/php/20190902-zts-debug/nd_mysql&quot;), /usr/local/lib/php/20190902-zts-debug/nd_mysql.so (Cannot open &quot;/usr/local/lib/php/20190902-zts-debug/nd_mysql.so&quot;)) in <b>Unknown</b> on line <b>0</b><br />
Unknown(0) : Warning - PHP Startup: Unable to load dynamic library 'nd_mysql' (tried: /usr/local/lib/php/20190902-zts-debug/nd_mysql (Cannot open &quot;/usr/local/lib/php/20190902-zts-debug/nd_mysql&quot;), /usr/local/lib/php/20190902-zts-debug/nd_mysql.so (Cannot open &quot;/usr/local/lib/php/20190902-zts-debug/nd_mysql.so&quot;))
 
Okay, I'm now confused, because mysqlnd seems to be loaded. Maybe it's no longer nd_mysql, and I have to alter respectively php.ini?

Code:
mysqlnd
mysqlnd => enabled
Version => mysqlnd 7.4.9
Loaded plugins => mysqlnd,debug_trace,auth_plugin_mysql_native_password,auth_plugin_mysql_clear_password

The whole output of the installation, starting php-fpm and looking into php capabilitties by phpinfo();
Code:
root@FAMP:~ # time portmaster -y -d --packages lang/php74 lang/php74-extensions archivers/php74-bz2 textproc/php74-ctype textproc/php74-dom security/php74-filter /usr/ports/graphics/php74-gd converters/php74-iconv devel/php74-json converters/php74-mbstring databases/php74-mysqli www/php74-opcache databases/php74-pdo databases/php74-pdo_mysql databases/php74-pdo_sqlite archivers/php74-phar sysutils/php74-posix www/php74-session textproc/php74-simplexml databases/php74-sqlite3 devel/php74-tokenizer textproc/php74-xml textproc/php74-xmlreader textproc/php74-xmlwriter archivers/php74-zip archivers/php74-zlib security/php74-openssl www/php74-tidy sysutils/php74-fileinfo graphics/php74-exif
root@FAMP:~ # php -r "print phpinfo();" | egrep -i ".ini|mysql"


Code:
root@FAMP:~ # egrep -v '^;|^ *$' /usr/local/etc/php.ini
[PHP]
engine = On
short_open_tag = Off
precision = 14
output_buffering = 4096
zlib.output_compression = Off
implicit_flush = Off
unserialize_callback_func =
serialize_precision = -1
disable_functions =
disable_classes =
zend.enable_gc = On
expose_php = On
max_execution_time = 30
max_input_time = 60
memory_limit = 128M
error_reporting = E_ALL
display_errors = On
display_startup_errors = On
log_errors = On
log_errors_max_len = 1024
ignore_repeated_errors = Off
ignore_repeated_source = Off
report_memleaks = On
html_errors = On
variables_order = "GPCS"
request_order = "GP"
register_argc_argv = Off
auto_globals_jit = On
post_max_size = 8M
auto_prepend_file =
auto_append_file =
default_mimetype = "text/html"
default_charset = "UTF-8"
doc_root =
user_dir =
enable_dl = Off
file_uploads = On
upload_max_filesize = 2M
max_file_uploads = 20
allow_url_fopen = On
allow_url_include = Off
default_socket_timeout = 60
extension=nd_mysql
[CLI Server]
cli_server.color = On
[Date]
date.timezone = Europe/Berlin
[filter]
[iconv]
[intl]
[sqlite3]
[Pcre]
[Pdo]
[Pdo_mysql]
pdo_mysql.cache_size = 2000
pdo_mysql.default_socket=
[Phar]
[mail function]
SMTP = localhost
smtp_port = 25
mail.add_x_header = Off
[ODBC]
odbc.allow_persistent = On
odbc.check_persistent = On
odbc.max_persistent = -1
odbc.max_links = -1
odbc.defaultlrl = 4096
odbc.defaultbinmode = 1
[Interbase]
ibase.allow_persistent = 1
ibase.max_persistent = -1
ibase.max_links = -1
ibase.timestampformat = "%Y-%m-%d %H:%M:%S"
ibase.dateformat = "%Y-%m-%d"
ibase.timeformat = "%H:%M:%S"
[MySQLi]
mysqli.max_persistent = -1
mysqli.allow_persistent = On
mysqli.max_links = -1
mysqli.cache_size = 2000
mysqli.default_port = 3306
mysqli.default_socket =
mysqli.default_host =
mysqli.default_user =
mysqli.default_pw =
mysqli.reconnect = Off
[mysqlnd]
mysqlnd.collect_statistics = On
mysqlnd.collect_memory_statistics = On
[OCI8]
[PostgreSQL]
pgsql.allow_persistent = On
pgsql.auto_reset_persistent = Off
pgsql.max_persistent = -1
pgsql.max_links = -1
pgsql.ignore_notice = 0
pgsql.log_notice = 0
[bcmath]
bcmath.scale = 0
[browscap]
[Session]
session.save_handler = files
session.use_strict_mode = 0
session.use_cookies = 1
session.use_only_cookies = 1
session.name = PHPSESSID
session.auto_start = 0
session.cookie_lifetime = 0
session.cookie_path = /
session.cookie_domain =
session.cookie_httponly =
session.serialize_handler = php
session.gc_probability = 1
session.gc_divisor = 1000
session.gc_maxlifetime = 1440
session.referer_check =
session.cache_limiter = nocache
session.cache_expire = 180
session.use_trans_sid = 0
session.sid_length = 26
session.trans_sid_tags = "a=href,area=href,frame=src,form="
session.sid_bits_per_character = 5
[Assertion]
zend.assertions = 1
[COM]
[mbstring]
[gd]
[exif]
[Tidy]
tidy.clean_output = Off
[soap]
soap.wsdl_cache_enabled=1
soap.wsdl_cache_dir="/tmp"
soap.wsdl_cache_ttl=86400
soap.wsdl_cache_limit = 5
[sysvshm]
[ldap]
ldap.max_links = -1
[dba]
[opcache]
[curl]
[openssl]


Code:
root@FAMP:~ # vi /usr/local/etc/php.ini
;   Be sure to appropriately set the extension_dir directive.
;
;extension=bz2
;extension=curl
;extension=fileinfo
;extension=gd2
;extension=gettext
;extension=gmp
;extension=intl
;extension=imap
;extension=interbase
;extension=ldap
;extension=mbstring
;extension=exif      ; Must be after mbstring as it depends on it
;extension=mysqli
;https://wordpress.org/support/topic/php-fatal-error-uncaught-error-call-to-undefined-function-mysql_connect-in/#post-12735487
;extension=nd_mysql
;extension=oci8_12c  ; Use with Oracle Database 12c Instant Client
;extension=odbc
;extension=openssl
;extension=pdo_firebird
;extension=pdo_mysql
;extension=pdo_oci
;extension=pdo_odbc
;extension=pdo_pgsql
;extension=pdo_sqlite
;extension=pgsql
;extension=shmop

; The MIBS data available in the PHP distribution must be installed.
; See http://www.php.net/manual/en/snmp.installation.php
;extension=snmp

;extension=soap
;extension=sockets
;extension=sqlite3
;extension=tidy
;extension=xmlrpc
;extension=xsl

;;;;;;;;;;;;;;;;;;;
; Module Settings ;
;;;;;;;;;;;;;;;;;;;

[CLI Server]
; Whether the CLI web server uses ANSI color coding in its terminal output.
cli_server.color = On

[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
/usr/local/etc/php.ini: 1909 lines, 70337 characters.


Code:
root@FAMP:~ # /usr/local/etc/rc.d/php-fpm onerestart
Performing sanity check on php-fpm configuration:
[29-Aug-2020 22:44:49] NOTICE: configuration file /usr/local/etc/php-fpm.conf test is successful

Stopping php_fpm.
Waiting for PIDS: 58308.
Performing sanity check on php-fpm configuration:
[29-Aug-2020 22:44:50] NOTICE: configuration file /usr/local/etc/php-fpm.conf test is successful

Starting php_fpm.
root@FAMP:~ #

But unfortunately, the WordPress 5.5 error, that I received after the upgrade from php72 to php74, doesn't disappears ...
Code:
Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /www/wp/soliform/wp-includes/wp-db.php:1670 Stack trace: #0 /www/wp/soliform/wp-includes/wp-db.php(632): wpdb->db_connect() #1 /www/wp/soliform/wp-includes/load.php(476): wpdb->__construct('wpggsoliform', 'xxxxxxx', 'wp_soliform', '127.0.0.1') #2 /www/wp/soliform/wp-settings.php(124): require_wp_db() #3 /www/wp/soliform/wp-config.php(121): require_once('/www/wp/solifor...') #4 /www/wp/soliform/wp-load.php(37): require_once('/www/wp/solifor...') #5 /www/wp/soliform/wp-blog-header.php(13): require_once('/www/wp/solifor...') #6 /www/wp/soliform/index.php(17): require('/www/wp/solifor...') #7 {main} thrown in /www/wp/soliform/wp-includes/wp-db.php on line 1670
https://wordpress.org/support/topic/php-fatal-error-uncaught-error-call-to-undefined-function-mysql_connect-in/#post-12735487
 
Back
Top