add error handling if PHP has been configured without DOM support