Jump to content

Introduction to the PHP SDK


xXMADEXx

Recommended Posts

Posted

Thank you everyone.

Oops, Something went wrong!

Error: Could not connect to **MY IP**:22005

:cry:

This is due because an Exception is being thrown.

This is probably because either:

- Your IP is wrong

- Your port is wrong (Look for httpport setting in mtaserver.conf)

- Your MTA server ports aren't open

- Your http user may not have the correct permissions

Posted

It's loading for 5 secs then it's print

Fatal error: Uncaught exception 'Exception' with message 'Could not connect to 5.39.66.97:22063' in /home/u375931079/public_html/mta/sdk/mta_sdk.php:146 Stack trace: #0 /home/u375931079/public_html/mta/sdk/mta_sdk.php(79): mta->do_post_request('5.39.66.97', 22063, '/someResource/c...', '') #1 /home/u375931079/public_html/mta/sdk/mta_sdk.php(257): mta->callFunction('someResource', 'someFunction', Array) #2 /home/u375931079/public_html/mta/index.php(5): Resource->call('someFunction') #3 {main} thrown in /home/u375931079/public_html/mta/sdk/mta_sdk.php on line 146 

Posted
It's loading for 5 secs then it's print
Fatal error: Uncaught exception 'Exception' with message 'Could not connect to 5.39.66.97:22063' in /home/u375931079/public_html/mta/sdk/mta_sdk.php:146 Stack trace: #0 /home/u375931079/public_html/mta/sdk/mta_sdk.php(79): mta->do_post_request('5.39.66.97', 22063, '/someResource/c...', '') #1 /home/u375931079/public_html/mta/sdk/mta_sdk.php(257): mta->callFunction('someResource', 'someFunction', Array) #2 /home/u375931079/public_html/mta/index.php(5): Resource->call('someFunction') #3 {main} thrown in /home/u375931079/public_html/mta/sdk/mta_sdk.php on line 146 

Are you sure that's the correct IP and port? If you navigate to http://5.39.66.97:22063 the page doesn't load either.

I got this error (In Chrome): ERR_CONNECTION_REFUSED

Posted

Yeah sorry it's closed now, I'll try with my second server

EDIT: Same error:

Fatal error: Uncaught exception 'Exception' with message 'Could not connect to 52.11.205.66:22006' in /home/u375931079/public_html/mta/sdk/mta_sdk.php:146 Stack trace: #0 /home/u375931079/public_html/mta/sdk/mta_sdk.php(79): mta->do_post_request('52.11.205.66', 22006, '/someResource/c...', '') #1 /home/u375931079/public_html/mta/sdk/mta_sdk.php(257): mta->callFunction('someResource', 'someFunction', Array) #2 /home/u375931079/public_html/mta/index.php(5): Resource->call('someFunction') #3 {main} thrown in /home/u375931079/public_html/mta/sdk/mta_sdk.php on line 146 

Posted
Yeah sorry it's closed now, I'll try with my second server

EDIT: Same error:

Fatal error: Uncaught exception 'Exception' with message 'Could not connect to 52.11.205.66:22006' in /home/u375931079/public_html/mta/sdk/mta_sdk.php:146 Stack trace: #0 /home/u375931079/public_html/mta/sdk/mta_sdk.php(79): mta->do_post_request('52.11.205.66', 22006, '/someResource/c...', '') #1 /home/u375931079/public_html/mta/sdk/mta_sdk.php(257): mta->callFunction('someResource', 'someFunction', Array) #2 /home/u375931079/public_html/mta/index.php(5): Resource->call('someFunction') #3 {main} thrown in /home/u375931079/public_html/mta/sdk/mta_sdk.php on line 146 

Add me on Skype (Madex-MTA) and I will try and help you there.

  • 2 weeks later...
Posted

You should close your PHP Code Tags every time

?> 

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

Posted
Helpful tutorial great job made like always.

Thanks! Hope it helps.

You should close your PHP Code Tags every time

?> 

Closing the PHP tags isn't required at the end of a file. It's only required if you want to start writing in HTML.

Non-requirment example:

<?php  
  
echo "This is a simple php script that doesn't end at the end of a file"; 
  

Required example:

<?php  
  
echo "This is a simple php script that does require an ending"; 
  
?> 
  
<br /> 
Because I want to write in HTML here... 

So basically for this tutorial, it would be completely pointless to even end the PHP tag.

Posted

i know The closing tag of a PHP block at the end of a file is optional, but in some cases omitting it is helpful when using include() or require().

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

Posted
i know The closing tag of a PHP block at the end of a file is optional, but in some cases omitting it is helpful when using include() or require().

Not really, the same rules apply -- It's basically useless.

Example, if I had this file functions.php that didn't have the ending:

<?php  
  
function func1 ( ) { 
    echo "Calling func 1"; 
} 

And I had this in index.php

  
<?php  
    include "functions.php"; 
?> 
  
HTML code 

it would still run the same as if the functions.php file did have the PHP ?> ending. PHP itself will automatically end the file.

  • 3 weeks later...
  • 1 month later...
Posted

Good job for ur tutorial,

I have got a problem, the web page could connect to my server :

Oops, Something went wrong!

Error: Could not connect to **.***.****.**:22005

i tested port and ip all should be fine.

I use web hoster but for the server i am testing it in local and give my ip of my pc.

EDIT : i tried with a server hosted by vortex and the result is same couldn't connect to the server.

  • 2 years later...
  • 9 months later...
Posted

hi. I have a problem:
 

Quote

Access Denied. This server requires authentication. Please ensure that a valid username and password combination is provided

How I can resolve?

Acl user added to admin permissions.

  • 2 years later...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...