I got the following error when I was building my PHP 5.3.5 on MySQL 5.5 / HTTPD 2.2.17 / CentOS 5.5 64bit.
checking for mysql_set_server_option in -lmysqlclient... no configure: error: wrong mysql library version or lib not found. Check config.log for more information.
I discovered the issue was with my build of MySQL 5.5. You need to disable DTRACE. I needed to add the following cmake config:
I then recompiled MySQL and rebuilt my PHP 5.3.5. Hope it helps.