Jump to content

Incoming cURL Requests


Recommended Posts

So I'm working with a dedicated linux box, I'm working on a script that interacts with a 3rd party app. This 3rd party app will, send me a Post cURL where my server handles the request looks up more data and replies as the output. Also in the same script I can POST to the third party app via cURL. I have my script set up correctly but I don't think my server is allowing the incoming cURL request because nothing is going through... I tried the exact same script and put it on a shared hosting server and it worked there.

So my question is, how do I verify that my server is refusing incoming cURL requests and how do I fix that?

Link to comment
Share on other sites


Temporarily change the script so it can process GET requests, then hit the URL through your browser? See if you get the expected response?




That works. My only concern is that maybe my firewall is blocking an external server from doing it.
Link to comment
Share on other sites

There are a few other checks you can make, but not sure your permissions will allow running them if you can't run phpinfo.

Save as curlinfo.php or whatever. It will return either cURL is enabled or cURL is not enabled.

<?php

echo 'cURL is '.(function_exists('curl_init') ?: ' not').' enabled';

?>

This one will either return your cURL verison or error if not available.

<?php

echo '<pre>';

var_dump(curl_version());

echo '</pre>';

?>

If your running a windows server, find un-comment this line in your php.ini

;extension=php_curl.dll

Link to comment
Share on other sites

Seems it is enabled:


array(9) {

  ["version_number"]=>

  int(464128)

  ["age"]=>

  int(3)

  ["features"]=>

  int(1565)

  ["ssl_version_number"]=>

  int(0)

  ["version"]=>

  string(6) "7.21.0"

  ["host"]=>

  string(17) "i686-pc-linux-gnu"

  ["ssl_version"]=>

  string(14) "OpenSSL/0.9.8b"

  ["libz_version"]=>

  string(5) "1.2.3"

  ["protocols"]=>

  array(17) {

	[0]=>

	string(4) "dict"

	[1]=>

	string(4) "file"

	[2]=>

	string(3) "ftp"

	[3]=>

	string(4) "ftps"

	[4]=>

	string(4) "http"

	[5]=>

	string(5) "https"

	[6]=>

	string(4) "imap"

	[7]=>

	string(5) "imaps"

	[8]=>

	string(4) "ldap"

	[9]=>

	string(5) "ldaps"

	[10]=>

	string(4) "pop3"

	[11]=>

	string(5) "pop3s"

	[12]=>

	string(4) "rtsp"

	[13]=>

	string(4) "smtp"

	[14]=>

	string(5) "smtps"

	[15]=>

	string(6) "telnet"

	[16]=>

	string(4) "tftp"

  }

}



I ran the second code.. I was getting a parse error because of the : in the first.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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