Both of those are "Warnings", and about PostgreSQL, not imagick.
Also note that you are referencing CWP's PHP, not the PHP version for websites.
We need more information to help you.
How are you trying to build PHP? Which Version? Post the last 50 lines of the log once the build fails.
Also note that if you are building PHP from within the CWP admin panel, it can take up to an hour to building depending on your system specs, so it won't be usable right away.