简体   繁体   中英

Connection refused error in PHP

[06-Nov-2013 17:57:32] PHP Warning: socket_connect() [function.socket-connect]: unable to connect [111]: Connection refused in /home2/whoop/public_html/phptesting/main.php on line 43

I keep getting this error. This is a snippet of code in my main.php

<?php

$host = '76.72.172.166';
$port = 25608;

$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); //Create the socket
$connected = socket_connect($socket, $host, $port);//Try and connect
?>

I am trying to setup a minecraft player list this is what im using http://forums.bukkit.org/threads/web-constantly-updated-website-widgets.148592/

Try as a UDP connection

$host = '76.72.172.166';
$port = 25608;

$socket = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP); //Create the socket
$connected = socket_connect($socket, $host, $port);//Try and connect

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