cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
365
Views
1
Helpful
4
Replies

file_get_contents does not work with IPv6

cassie2698bratt
Level 1
Level 1

Hello,

I have an runtime message error. within a PHP script I try to read from an IPv6 address by using function file_get_contents but during runtime the following message occur,  Mary Kay InTouch

Failed to open stream: Connection refused

When running the address in browser it returns the message expected. 

 

$return_value = file_get_contents("http://[ipv6-address]");

 

 Any help would be appreciated! Thanks in advance! 

 

4 Replies 4

Rich R
VIP
VIP

Hi @cassie2698bratt I don't think this has anything to do with Cisco equipment or networks?

Connection refused
The server refused your connection - check the server logs for reason.
Could be the server is redirecting to https and your client doesn't support https for example?
Enable debugging and logging for your client to understand why it's failing.

Harold Ritter
Cisco Employee
Cisco Employee

Hi @cassie2698bratt ,

What destination port number do you use? Is that port number bound to the destination ipv6 address on the destination host (netstat -an)?

Regards,

Harold Ritter
Sr Technical Leader
CCIE 4168 (R&S, SP)
harold@cisco.com
México móvil: +52 1 55 8312 4915
Cisco México
Paseo de la Reforma 222
Piso 19
Cuauhtémoc, Juárez
Ciudad de México, 06600
México

Rich R
VIP
VIP

@Harold Ritter they say "When running the address in browser it returns the message expected." which implies it is bound on the server.

@cassie2698bratt use browser network trace (F12 or CRTL+SHIFT+I) to see exactly what is happening in the browser when fetching the URL.

Hi @Rich R ,

You are totally right. It looks like I read over that part.

Regards,

Harold Ritter
Sr Technical Leader
CCIE 4168 (R&S, SP)
harold@cisco.com
México móvil: +52 1 55 8312 4915
Cisco México
Paseo de la Reforma 222
Piso 19
Cuauhtémoc, Juárez
Ciudad de México, 06600
México