I see this issue posted on countless threads, and the majority of the time, it is because PHP is not aware that you are on a 64-bit system and your libraries are sitting in /usr/lib64.
The solution that everyone provides is to create symbolic links from the library that PHP is expecting to the 64-bit library itself.
Okay, workable solution, but what a pain in the heck if you have quite a few libraries!
PHP has dealt with this issue by offering the –with-libdir configuration option.
You might be tempted to provide the full path to your libraries in this option, but for some reason, this simply doesn't work.
The example below demonstrates proper usage: