libxml2 is neither part of PHP, nor of Apache. It seems that you do not have it installed or not configured properly, based on the error message. Otherwise I do not see why that specific PHP version shouldn't work with Apache.
When installing any package by means of an updater/installer tool like yum or apt, then dependencies should be solved automatically. If you are building/installing your own PHP and Apache executables, then you must take care of dependencies yourself. You will have to provide more info to get proper help on this.
Linux Archive