I am new to PHP and web development. I am trying to build a basic Facebook application. Hence it is necessary to use Http Requests to get user data from Graph API within Facebook. I checked how to make requests with PHP yet I saw that Http request methods are not built-in. I understand that I need to install appropriate libraries to use them and everything was fine until I got that it is almost impossible to install Pecl or Pear to a hosting service(i am using Godaddy).
I have looked into lots of sites including Stackoverflow yet there are no answers. Plenty of sites explain how to install packages to a local server.
I could only tried Pear | go-pear.phar web installation yet it did not work. I do not know how to execute a .phar file even though I checked the documentation(Pear Installation Doc). This link, Installing Pear on Godaddy Hosting, explains what I have tried to do.
One more question, if it is not possible to install any of these packages, so how to I make HTTP Requests with PHP? Is there any other way?
Thanks for any answer.
php can do http requests, if allow_url_fopen is enabled. And there's always the CURL library (if enabled). You can test both with something as simple as:
$c = curl_init();
$txt = file_get_contents('http://google.com');
If curl's not installed, the first line fails. If url operations are disabled, then the second line will fail.