DOMDocument Remote Load Error failed to open stream:permission denied how to handle
Source: Internet
Author: User
DOMDocument Remote Load Error failed to open Stream:permission denied what to do?
The code is simple. That's it...
$doc = new DOMDocument ();
$doc-Load (' http://223.4.174.61:22093/quoteFile/quote.xml ');
The error is as follows
Domdocument::load (Http://223.4.174.61:22093/quoteFile/quote.xml): Failed to open Stream:permission denied
Local testing is fine. , but not on the server.
The server tries to use fopen file_get_contents to prompt Permission denied, but open another remote connection is no problem.
Look for the gods of the road.
------Solution--------------------
The server has disabled the open remote file
If it's not an autonomous server, most of them are banned.
------Solution--------------------
22093 Port not open
------Solution--------------------
Is your server Linux? How to open a port under your own search
------Solution--------------------
Linux firewall iptables Open Network Port method
1. Edit the Vi/etc/sysconfig/iptables file, such as:
-A rh-firewall-1-input-m state–state new-m tcp-p tcp–dport 22-j ACCEPT
-A rh-firewall-1-input-m state–state new-m tcp-p tcp–dport 80-j ACCEPT
-A rh-firewall-1-input-m state–state new-m tcp-p tcp–dport 8080-j ACCEPT
......
2. Restart Iptalbes Service:/etc/init.d/iptables restart
Do not know what your server is operating system
------Solution--------------------
In short it is to find the reason for you, because I $doc-load (' http://223.4.174.61:22093/quoteFile/quote.xml ');
Can get the data
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.