Php Api Server Requirements

Hi All

what is server requirements to run api php class

because when im trying to use api php class

it can’t connect to the server

api service enabled in mikrotik

the same class worked on free space ( heliohost.org hosting )

but it didn’t work on my site ( orioncities.com hosting )

any body can help me ??

thanks and i hop that my english helped me to explain my problem

It requires that socket functions are enabled (fsockopen() in Denis’ client, stream_socket_client() with my client), and I think it requires allow_fopen_url to be true too. Both are enabled by default in PHP, but orioncities.com may have disabled those.

My client in particular also requires a minimum of PHP 5.3.

Contact orioncities.com about this.

thanx fsockopen is the problem orioncites said this function disabled

this is the phpinfo

http://www.orionstorage.com/info.php

and i use

  • RouterOS PHP API class v1.4
  • Author: Denis Basta

please tell me if any functions disabled

i will ask them to enable fsockopen

but if they refused can i replace fsockopen with another function?

Looking at the phpinfo output, you may replace fsockopen() with stream_socket_client(), but I’d strongly advise against that: If they’ve disabled socket connections, then they have some concerns, and if you try to bypass their restrictions, sooner or later, they’ll find out you did and simply add stream_socket_client() to the list of blocked functions, and break your scripts.

If they refuse to enable socket functions, simply switch to another host. And if it comes down to this, do them a favor and tell them to add stream_socket_client() to their list :wink: .