简体   繁体   中英

Simple_XML cross-domain file access disabled

I need to retrieve an XML file from another domain I own from PHP.

I'm using simple_XML to do it but, apparently, cross-domain is disabled:

Warning: simplexml_load_file() [function.simplexml-load-file]: URL file-access is disabled in the server configuration

I have no access to server's config (shared hosting).

Any clue on how to perform this?

Your host disabled it by setting allow_url_fopen in php.ini to off.

You may need to talk to them about having this enabled.

You can try using cURL to download the remote file then loading the string into SimpleXML instead of a remote file path.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM