PHP only includes the MySql client software, it has nothing to do with the MySql server. What I mean is that you don't need a mysql server on your machine to build php.
Did you specify the location of your mysql libraries when you configured php? If you do not it will use the bundled libraries. I have had problems building php from source when mysql has been installed using rpms. The rpms usually install the libraries in non-standard locations, and this can make the process 'difficult'.
I still don't see why you want to do this. A 3.23.58 client library will work just fine with a 4.0.20 server. This is not normally something you would have to worry about.
Hardware and performance
phpinfo() doesn't show updated mysql version
This discussion has been locked so you can no longer reply to it.