Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
.Peter Posted March 31, 2011 Posted March 31, 2011 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?
tomturd2 Posted March 31, 2011 Posted March 31, 2011 Temporarily change the script so it can process GET requests, then hit the URL through your browser? See if you get the expected response?
.Peter Posted March 31, 2011 Author Posted March 31, 2011 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.
.Peter Posted March 31, 2011 Author Posted March 31, 2011 Just run a phpinfo and look for cURL. Lol.... Warning: phpinfo() has been disabled for security reasons in Command line code on line 1
Royzee Posted March 31, 2011 Posted March 31, 2011 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
.Peter Posted March 31, 2011 Author Posted March 31, 2011 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.
Royzee Posted March 31, 2011 Posted March 31, 2011 It may be installed and compiled with PHP but not enabled. Check your php.ini file. You need the following line. Either add it, or uncomment if there with a ';' before it.extension=curl.so
Recommended Posts
Archived
This topic is now archived and is closed to further replies.