=DC= Posted January 20, 2017 Share Posted January 20, 2017 Hi, today i was trying to do function which displays players who are online on my website using php_sdk and i have problem with connection to server. HTTP port is opened, user who i'm using to connect has admin rights and it's not working. mta_sdk version 0.4 - downloaded from wiki mta this is php file on my website: <?php include( "mta_sdk.php" ); $mtaServer = new mta( "ip", 20145, "mta_php_sdk", "password" ); $resource = $mtaServer->getResource ( "php" ); $returns[] = $resource->call ( "getPlayersOnline" ); ?> And the error: Fatal error: Uncaught exception 'Exception' with message 'Could not connect to ip:20145' in /home/users/XXX/public_html/YYY/mta_php_sdk/mta_sdk.php:146 Stack trace: #0 /home/users/XXX/public_html/YYY/mta_php_sdk/mta_sdk.php(79): mta->do_post_request('ip', 20145, '/php/call...', '') #1 /home/users/XXX/public_html/YYY/mta_php_sdk/mta_sdk.php(257): mta->callFunction('php', 'getPlayersOnlin...', Array) #2 /home/users/XXX/public_html/YYY/mta_php_sdk/mta.php(38): Resource->call('getPlayersOnlin...') #3 {main} thrown in /home/users/XXX/public_html/YYY/mta_php_sdk/mta_sdk.php on line 146 If i visit in my browser ip:20145/php/call/getPlayersOnline everything is working correctly. How can i fix it? Link to comment
LoPollo Posted January 20, 2017 Share Posted January 20, 2017 (edited) "ip" I did never use that SDK, but i guess it should be an ip... like "127.0.0.1"? But i'm certain "ip" is not an ip Edited January 20, 2017 by LoPollo Link to comment
=DC= Posted January 20, 2017 Author Share Posted January 20, 2017 Yes, you're right i hid it because not everybody must know it There is my server ip without port ofcourse. I found some info about this and it looks that my website hosting is blocking some functions like e.g. fsockopen Link to comment
LoPollo Posted January 20, 2017 Share Posted January 20, 2017 Oh, right. Didn't think about this. Link to comment
=DC= Posted January 21, 2017 Author Share Posted January 21, 2017 I was searching more and more info about SDK and mine problem is that my website hosting is blocking some ports, so I can't connect to server, but I asked them to open it and I hope that it resolve everything. When I was testing this code on WebServ everything was working fine Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now