Php 无法打开流:HTTP请求失败!HTTP/1.0 503服务不可用

Php 无法打开流:HTTP请求失败!HTTP/1.0 503服务不可用,php,Php,我以root用户身份连接到服务器,我有一个简单的php脚本: <?php $url ="http://www.ec.europa.eu/taxation_customs/vies/checkVatService.wsdl"; fopen($url, 'r'); ?> 请注意,当我尝试另一个url exp:script时,它不会显示任何警告或错误,当我在浏览器中键入所需的url时,它也会工作。 我检查了php.ini,变量allow\u url\u fopen已经设置为On。 从另一

我以root用户身份连接到服务器,我有一个简单的php脚本:

<?php
$url ="http://www.ec.europa.eu/taxation_customs/vies/checkVatService.wsdl";
fopen($url, 'r');
?>
请注意,当我尝试另一个url exp:script时,它不会显示任何警告或错误,当我在浏览器中键入所需的url时,它也会工作。 我检查了php.ini,变量
allow\u url\u fopen
已经设置为
On
。 从另一台服务器上,我尝试了相同的脚本(相同的url),它工作正常,因此问题与我的服务器有关,而不是与所需的服务有关。 你知道如何避免这种情况吗

编辑: $url=”“

给出:

* About to connect() to ec.europa.eu port 80 (#0)
*   Trying 2001:bc8:3408:200::2... * connected
> GET /taxation_customs/vies/checkVatService.wsdl HTTP/1.1
Host: ec.europa.eu
Accept: */*

* HTTP 1.0, assume close after body
< HTTP/1.0 503 Service Unavailable
< Cache-Control: no-cache
< Connection: close
< Content-Type: text/html
< Content-Length: 310
< 
* Excess found in a non pipelined read: excess = 20, size = 310, maxdownload = 310, bytecount = 0
* Closing connection #0
string(310) "<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Error</title>
</head>
<body>
<h1>Erreur 503</h1>
<h2>Erreur proxy ipv6</"
*即将()连接到ec.europa.eu端口80(#0)
*2001:bc8:3408:200::2…*有联系的
>GET/taxing\u customs/vies/checkVatService.wsdl HTTP/1.1
主持人:ec.europa.eu
接受:*/*
*HTTP 1.0,假设在正文之后关闭
Erreur proxy ipv6使用简单的curl请求

$url = "http://www.ec.europa.eu/taxation_customs/vies/checkVatService.wsdl";

$ch = curl_init();

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_URL, $url);

$result = curl_exec($ch);
var_dump($result);
返回“访问被拒绝您的请求因安全原因被拒绝”您确定没有阻止您端的请求吗

* About to connect() to ec.europa.eu port 80 (#0)
*   Trying 2001:bc8:3408:200::2... * connected
> GET /taxation_customs/vies/checkVatService.wsdl HTTP/1.1
Host: ec.europa.eu
Accept: */*

* HTTP 1.0, assume close after body
< HTTP/1.0 503 Service Unavailable
< Cache-Control: no-cache
< Connection: close
< Content-Type: text/html
< Content-Length: 310
< 
* Excess found in a non pipelined read: excess = 20, size = 310, maxdownload = 310, bytecount = 0
* Closing connection #0
string(310) "<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Error</title>
</head>
<body>
<h1>Erreur 503</h1>
<h2>Erreur proxy ipv6</"
$url = "http://www.ec.europa.eu/taxation_customs/vies/checkVatService.wsdl";

$ch = curl_init();

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_URL, $url);

$result = curl_exec($ch);
var_dump($result);