I have installed PHP, but when I to access a PHP script file via my browser, I get the error:
This has actually nothing to do with PHP, but with the MySQL client libraries. Some need --with-zlib, others do not. This is also covered in the MySQL FAQ.