Centova Technologies Forum

Centova Cast v3 => General discussion => Topic started by: leand.regg on June 07, 2016, 09:05:34 pm

Title: Exec PHP API
Post by: leand.regg on June 07, 2016, 09:05:34 pm
I need help to exec the URL from PHP.

I have de URL http:/IP:2199/api.php?xm=server.stop&f=json&a[username]=test&a[password]=test

If I go to this url in the browser, it works. But, I cannot make it works in PHP.

Someone have an example code?

Thanks!
Title: Re: Exec PHP API
Post by: My Auto DJ on June 08, 2016, 04:19:23 am
<?php
simplexml_load_file('http:/IP:2199/api.php?xm=server.stop&f=json&a[username]=test&a[password]=test' );
?>
Title: Re: Exec PHP API
Post by: edinsof on June 27, 2016, 07:01:04 am
same problem for me (simplexml_load_file) only run on same server, i need run php script on external hosting server
Title: Re: Exec PHP API
Post by: My Auto DJ on June 27, 2016, 07:37:00 am
It may be disabled on your web server,

allow_url_fopen needs to be on in your php.ini

OR you can also use CURL.

http://stackoverflow.com/questions/11553678/read-xml-data-from-url-using-curl-and-php
Title: Re: Exec PHP API
Post by: edinsof on June 27, 2016, 10:00:02 am
allow_url_fopen is enabled on webserver and centovacast server
im test with CURL from web server to http://micentovahost.com and works but when test from web server to http://micentovahost.com:2199/api.php it dont connect, 2199 por is open on server firewall but dont reply

if i use XMLHttpRequest this works but i need to het working with PHP