PHP parsing xml file is error: I/O warning:failed to load external entity

Source: Internet
Author: User

Add at top of code

Libxml_disable_entity_loader (false);

The Libxml_disable_entity_loader () function is to set whether to prohibit the external loading of XML entities, set to true is forbidden, the purpose is to prevent the XML injection attack (details of self-Baidu), the intention is good, but this after the setting of a bug (specifically, There is time to study, perhaps this bug in the high version of PHP has been resolved, no verification, in short, there is such a bug, have studied the friend can tell me why, and affect the normal operation of the service.

For programs that encounter the same problem apes, you can try this method to solve them.

PHP parsing xml file is error: I/O warning:failed to load external entity

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.