Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

need help #1

Closed
malitha22 opened this issue Mar 1, 2023 · 10 comments
Closed

need help #1

malitha22 opened this issue Mar 1, 2023 · 10 comments

Comments

@malitha22
Copy link

malitha22 commented Mar 1, 2023

Error Code: 0 php_network_getaddresses: getaddrinfo failed: Name or service not known

need help with this!
thanks

@malitha22 malitha22 changed the title syntax errors need help Mar 1, 2023
@dennisabrams
Copy link
Owner

dennisabrams commented Mar 1, 2023

Hey @malitha22,

It looks like DNS isn't working properly on your machine if you typed the name of your TS3 server inside the config.php

$server_ip = "127.0.0.1";

Did you tried to put the IP address of your TS3 server instead?

@malitha22
Copy link
Author

yes! I tried 127.0.0.1/localhost/ts3ip/domain

@malitha22
Copy link
Author

but it didnt work

@dennisabrams
Copy link
Owner

The problem is that the API can't connect to your TS3 Server Query.

Check if port 10011 is open in your firewall.

You can check if your server query accepts TCP connections with this small program:

<?php
$host = "YOUR TS3 SERVER IP"; 
$port = 10011; 
$waitTimeoutInSeconds = 1; 
if($fp = fsockopen($host,$port,$errCode,$errStr,$waitTimeoutInSeconds)){   
   echo("Online"); // Can create a connection
} else {
   echo("Offline"); // Can't create a connection
} 
fclose($fp);
?>

@malitha22
Copy link
Author

@dennisabrams its online!

@malitha22
Copy link
Author

@dennisabrams I tried with different vps and teamspeak servers but didnt work!

@dennisabrams
Copy link
Owner

dennisabrams commented Mar 2, 2023

<?php
require_once("libraries/TeamSpeak3/TeamSpeak3.php"); // Your TS3 PHP framework path

$serverquery_username = "serveradmin";
$serverquery_password = "PASSWORD";
$server_ip = "127.0.0.1";
$serverquery_port = "10011";
$server_port = "9987";

try
{ 
  $conn = "serverquery://$serverquery_username:$serverquery_password@$server_ip:$serverquery_port/?server_port=$server_port";
  $ts3_VirtualServer = TeamSpeak3::factory($conn);
  echo($ts3_VirtualServer);
}
catch(TeamSpeak3_Exception $e)
{
  echo "Error Code:" . $e->getCode() . ": " . $e->getMessage();
}
?>

Warning
Check if there are any special signs (special characters like: !@#$%^&*()_+:) inside the serverquery password! TS3 PHP Framework doesn't like special characters at all! If you use it and don't want to change your password ~ use rawurlencode.

So if you tried this and it still fails, check the Teamspeak 3 PHP Framework Docs and the informations & requirements inside the README.md.

If your server is using an IPv6 adress it must be written within square brackets: $conn = "serverquery://username:password@[fe80::250:56ff:fe16:1447]:10011/";

@malitha22
Copy link
Author

thankyou so much! , the problem was the serverquery password its start with "@"

@dennisabrams
Copy link
Owner

dennisabrams commented Mar 2, 2023

No problem, I'm glad I could help 😊. I will add this problem to the README.md and update the program soon, because I'm not completely finished yet 😅.

@dennisabrams dennisabrams pinned this issue Mar 2, 2023
@dennisabrams
Copy link
Owner

Special characters can be used inside the serverquery username & password now.

Username & password will be encoded to RFC 3986 by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants