02-13-2021, 02:24 PM
(This post was last modified: 02-13-2021, 04:59 PM by waraywarayako.)
Good Day,
I am working with Online Games Frontend Template. werein I am fetching data from GAMES REMOTE server. I am able to connect to the remote server MSSQL Database but the fsockopen() does not work and I already allowed the Web Hosting IP to our Server Inbound connection. Please see codes below
when I var_dump the ($sockres) this was the result
I`ve search a lot on the internet but we have different error, their is for send Emails while mine is only to check if the Server is ONLINE or OFFLINE
NOTE: This is working on a local PC, but if it for my webhosting to remote game server it won`t work except for fetching data from remote server MSSQL database.
I am working with Online Games Frontend Template. werein I am fetching data from GAMES REMOTE server. I am able to connect to the remote server MSSQL Database but the fsockopen() does not work and I already allowed the Web Hosting IP to our Server Inbound connection. Please see codes below
PHP Code:
function getServerConnection($ip, $port) {
$sockres = @fsockopen($ip, $port, $errno, $errstr, 0.01);
if (!$sockres) {
return '<b class="text-danger">OFFLINE</b>';
} else {
@fclose($sockres);
return '<b class="text-success">ONLINE</b>';
}
}
when I var_dump the ($sockres) this was the result
Quote:A PHP Error was encountered
Severity: Warning
Message: fsockopen(): unable to connect to 192.168.1.1:80 (Connection timed out) - JUST DUMMY IP. IT HAS A REAL REMOTE IP
Filename: helpers/myhelper_helper.php
bool(false) int(110) string(20) "Connection timed out"
I`ve search a lot on the internet but we have different error, their is for send Emails while mine is only to check if the Server is ONLINE or OFFLINE
NOTE: This is working on a local PC, but if it for my webhosting to remote game server it won`t work except for fetching data from remote server MSSQL database.