# php error: "libmysqlclient.so.16" not found



## beesatmsu (Dec 4, 2010)

I have tried everything...

last time (3 months ago) I used [cmd=]portugrade -aRv -O[/cmd] and it worked fine, which initially had these same error messages.

now on a slightly different server, that command did not work. I then deleted all packages, and started from scratch, still the same error.

I then deleted all packages, upgraded from 8.0 to 8.1, upgraded all ports using [cmd=]portmanage -u[/cmd] then tried again...
still the same error:

I am running of ideas (other than a clean install of the system). 

apache22, mysql55-server were installed before php5. 


```
queen# cd php5-extensions
queen# ls
Makefile        pkg-descr       work
queen# make install clean
===>  Installing for php5-extensions-1.4
===>   php5-extensions-1.4 depends on file: /usr/local/include/php/main/php.h - found
===>   php5-extensions-1.4 depends on file: /usr/local/lib/php/20090626-debug/bz2.so - not found
===>    Verifying install for /usr/local/lib/php/20090626-debug/bz2.so in /usr/ports/archivers/php5-bz2
===>   Returning to build of php5-extensions-1.4
===>   php5-extensions-1.4 depends on file: /usr/local/lib/php/20090626-debug/ctype.so - not found
===>    Verifying install for /usr/local/lib/php/20090626-debug/ctype.so in /usr/ports/textproc/php5-ctype
===>   Returning to build of php5-extensions-1.4
===>   php5-extensions-1.4 depends on file: /usr/local/lib/php/20090626-debug/dom.so - not found
===>    Verifying install for /usr/local/lib/php/20090626-debug/dom.so in /usr/ports/textproc/php5-dom
===>   Returning to build of php5-extensions-1.4
===>   php5-extensions-1.4 depends on file: /usr/local/lib/php/20090626-debug/exif.so - not found
===>    Verifying install for /usr/local/lib/php/20090626-debug/exif.so in /usr/ports/graphics/php5-exif
===>   Returning to build of php5-extensions-1.4
===>   php5-extensions-1.4 depends on file: /usr/local/lib/php/20090626-debug/filter.so - not found
===>    Verifying install for /usr/local/lib/php/20090626-debug/filter.so in /usr/ports/security/php5-filter
===>  Building for php5-filter-5.3.3_2
/bin/sh /usr/ports/security/php5-filter/work/php-5.3.3/ext/filter/libtool --mode=compile cc  -I. -I/usr/ports
/security/php5-filter/work/php-5.3.3/ext/filter -DPHP_ATOM_INC -I/usr/ports/security/php5-filter/work/php-
5.3.3/ext/filter/include -I/usr/ports/security/php5-filter/work/php-5.3.3/ext/filter/main -I/usr/ports/security
/php5-filter/work/php-5.3.3/ext/filter -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local
/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext
/date/lib  -DHAVE_CONFIG_H  -pipe -fno-strict-aliasing -O0   -c /usr/ports/security/php5-filter/work/php-
5.3.3/ext/filter/logical_filters.c -o logical_filters.lo
 cc -I. -I/usr/ports/security/php5-filter/work/php-5.3.3/ext/filter -DPHP_ATOM_INC -I/usr/ports/security/php5
filter/work/php-5.3.3/ext/filter/include -I/usr/ports/security/php5-filter/work/php-5.3.3/ext/filter/main -I/usr
/ports/security/php5-filter/work/php-5.3.3/ext/filter -I/usr/local/include/php -I/usr/local/include/php/main 
-I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include
/php/ext/date/lib -DHAVE_CONFIG_H -pipe -fno-strict-aliasing -O0 -c /usr/ports/security/php5-filter/work/php-
5.3.3/ext/filter/logical_filters.c  -fPIC -DPIC -o .libs/logical_filters.o
In file included from /usr/ports/security/php5-filter/work/php-5.3.3/ext/filter/logical_filters.c:25:
/usr/local/include/php/ext/pcre/php_pcre.h:29:18: error: pcre.h: No such file or directory
In file included from /usr/ports/security/php5-filter/work/php-5.3.3/ext/filter/logical_filters.c:25:
/usr/local/include/php/ext/pcre/php_pcre.h:37: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
/usr/local/include/php/ext/pcre/php_pcre.h:38: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
/usr/local/include/php/ext/pcre/php_pcre.h:44: error: expected specifier-qualifier-list before 'pcre'
/usr/ports/security/php5-filter/work/php-5.3.3/ext/filter/logical_filters.c: In function 'php_filter_validate_regexp':
/usr/ports/security/php5-filter/work/php-5.3.3/ext/filter/logical_filters.c:411: error: 'pcre' undeclared (first use in this function)
/usr/ports/security/php5-filter/work/php-5.3.3/ext/filter/logical_filters.c:411: error: (Each undeclared identifier is reported only once
/usr/ports/security/php5-filter/work/php-5.3.3/ext/filter/logical_filters.c:411: error: for each function it appears in.)
/usr/ports/security/php5-filter/work/php-5.3.3/ext/filter/logical_filters.c:411: error: 're' undeclared (first use in this function)
/usr/ports/security/php5-filter/work/php-5.3.3/ext/filter/logical_filters.c:412: error: 'pcre_extra' undeclared (first use in this function)
/usr/ports/security/php5-filter/work/php-5.3.3/ext/filter/logical_filters.c: In function 'php_filter_validate_email':
/usr/ports/security/php5-filter/work/php-5.3.3/ext/filter/logical_filters.c:527: error: 'pcre' undeclared (first use in this function)
/usr/ports/security/php5-filter/work/php-5.3.3/ext/filter/logical_filters.c:527: error: 're' undeclared (first use in this function)
/usr/ports/security/php5-filter/work/php-5.3.3/ext/filter/logical_filters.c:528: error: 'pcre_extra' undeclared (first use in this function)
*** Error code 1
1 error
*** Error code 1

Stop in /usr/ports/security/php5-filter.
*** Error code 1

Stop in /usr/ports/lang/php5-extensions.
*** Error code 1

Stop in /usr/ports/lang/php5-extensions.
```

current packages on the system:


```
queen# pkg_info
apache-2.2.17_1     Version 2.2.x of Apache web server with prefork MPM.
apr-ipv6-devrandom-gdbm-db42-1.4.2.1.3.10 Apache Portability Library
autoconf-2.68       Automatically configure source code on many Un*x platforms
autoconf-wrapper-20101119 Wrapper script for GNU autoconf
db42-4.2.52_5       The Berkeley DB package, revision 4.2
expat-2.0.1_1       XML 1.0 parser written in C
gdbm-1.8.3_3        The GNU database manager
gettext-0.18.1.1    GNU gettext package
gmake-3.81_4        GNU version of 'make' utility
help2man-1.38.2_1   Automatically generating simple manual pages from program o
libiconv-1.13.1_1   A character set conversion library
libsigsegv-2.8      Handling page faults in user mode
libtool-2.2.10      Generic shared library support script
libxml2-2.7.8_1     XML parser library for GNOME
m4-1.4.15,1         GNU m4
mysql-client-5.5.7  Multithreaded SQL database (client)
mysql-server-5.5.7  Multithreaded SQL database (server)
p5-Locale-gettext-1.05_3 Message handling functions
pcre-8.10           Perl Compatible Regular Expressions library
perl-5.10.1_3       Practical Extraction and Report Language
php5-5.3.3_2        PHP Scripting Language
pkg-config-0.25_1   A utility to retrieve information about installed libraries
portmanager-0.4.1_9 FreeBSD installed ports status and safe update utility
postgresql-client-8.2.18_1 PostgreSQL database (client)
python-2.6,2        The "meta-port" for the default version of Python interpret
python26-2.6.6      An interpreted object-oriented programming language
```


----------



## DutchDaemon (Dec 5, 2010)

Error in pcre.h? Pretty sure it's this one:

[cmd=]less +/20100409 /usr/ports/UPDATING[/cmd]


----------



## beesatmsu (Dec 5, 2010)

yes, I tried deleting all the packages (none were there since I used "pkg_delete -a") -- since you said I failed to do this last time 


  1) Delete the following packages (if installed):

     - php5-dbase
     - php5-ncurses
     - php5-pcre
     - php5-spl
     - php5-ming
     - php5-mhash

In addition, pkg_info does not say php5-pcre is there.. should I install extensions first, before installing php5?

it is possible some traces there..(since pkg_delete say some were left not deleted)...how to remove them completely?

Thanks.  Zach


----------



## beesatmsu (Dec 5, 2010)

tried php52 and both it and extensions seem to have worked...


----------



## beesatmsu (Dec 5, 2010)

now another strange problem...

so I had everything working (mysql, php, apache), then found I cannot restore my mysql5.0's data to 5.5, so deinstalled 5.5, and reinstalled 5.0, then found php wont work...


```
queen# php -v
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20060613-debug/mysql.so' - 
Shared object "libmysqlclient.so.16" not found, required by "mysql.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20060613-debug/pdo_mysql.so'
 - Shared object "libmysqlclient.so.16" not found, required by "pdo_mysql.so" in Unknown on line 0
PHP 5.2.14 with Suhosin-Patch 0.9.7 (cli) (built: Dec  5 2010 17:20:44) (DEBUG)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies
```

I tried reinstalling php52, still the same...

/usr/local/lib/mysql has the .16 file missing, but has .15 instead:


```
-r--r--r--  1 root  wheel     1414 Dec  5 17:01 libdbug.a
-r--r--r--  1 root  wheel    51518 Dec  5 17:01 libheap.a
-r--r--r--  1 root  wheel   385878 Dec  5 17:01 libmyisam.a
-r--r--r--  1 root  wheel    30950 Dec  5 17:01 libmyisammrg.a
-rw-r--r--  1 root  wheel   504564 Dec  5 16:57 libmysqlclient.a
-rwxr-xr-x  1 root  wheel      987 Dec  5 16:57 libmysqlclient.la
lrwxr-xr-x  1 root  wheel       20 Dec  5 16:57 libmysqlclient.so -> libmysqlclient.so.15
-rwxr-xr-x  1 root  wheel   434167 Dec  5 16:57 libmysqlclient.so.15
-rw-r--r--  1 root  wheel   514416 Dec  5 16:57 libmysqlclient_r.a
-rwxr-xr-x  1 root  wheel     1010 Dec  5 16:57 libmysqlclient_r.la
lrwxr-xr-x  1 root  wheel       22 Dec  5 16:57 libmysqlclient_r.so -> libmysqlclient_r.so.15
-rwxr-xr-x  1 root  wheel   440328 Dec  5 16:57 libmysqlclient_r.so.15
-r--r--r--  1 root  wheel  9942022 Dec  5 17:01 libmysqld.a
-r--r--r--  1 root  wheel   283510 Dec  5 17:01 libmystrings.a
-r--r--r--  1 root  wheel   331934 Dec  5 17:01 libmysys.a
-r--r--r--  1 root  wheel     7976 Dec  5 17:01 libvio.a
```

somehow mysql55 did not remove everything? and things got mixed up with mysql50? 

Zach


----------



## wblock@ (Dec 5, 2010)

beesatmsu said:
			
		

> I have tried everything...
> 
> last time (3 months ago) I used [cmd=]portugrade -aRv -O[/cmd] and it worked fine, which initially had these same error messages.



The -a option to portupgrade is a superset of -R, so -R (or -r) is unnecessary when you use -a.  The -O option... why would you want to bypass dependency checking?  Let the program help you unless there's a really good reason to prevent it.


----------



## beesatmsu (Dec 5, 2010)

I installed php52-mysql, now one less error message, but still complains about .16

the first php warning is gone...


```
queen# php -v
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20060613-debug/pdo_mysql.so' - 
Shared object "libmysqlclient.so.16" not found, required by "pdo_mysql.so" in Unknown on line 0
PHP 5.2.14 with Suhosin-Patch 0.9.7 (cli) (built: Dec  5 2010 18:12:39) (DEBUG)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies
```

wordpress complains:

```
Your PHP installation appears to be missing the MySQL extension which is required by WordPress.
```

even though I did reinstall mysql50 and php52 a few times.


----------



## beesatmsu (Dec 6, 2010)

indeed there were some mix up of php52 and php5.3.x. I found a few left over packages of php5.3:


```
php5-bz2-5.3.3_2
php5-ctype-5.3.3_2
php5-dom-5.3.3_2
php5-exif-5.3.3_2
```

pkg_delete says it cannot delete them, so I removed them by hand...

restarted apache22 and now wordpress works, so does phpmyadmin, despite of the same php warning..


----------

