I had the similar problem and it was because of my installed libxml2 version was newer than 2.9.0. So as explained here you can fix it by applying the following patch: Go to your php source folder:
$ cd ~/.phpbrew/build/php-{version}/
Then download and apply the following patch:
$ curl -s https://mail.gnome.org/archives/xml/2012-August/txtbgxGXAvz4N.txt | patch -p0
加上补丁吧