EchoFool Posted June 23, 2009 Share Posted June 23, 2009 I have gone into my apache/php.ini and allowed this line: extension=php_curl.dll But according to my script with curl involved it still gives me the same issue which is : Fatal error: Call to undefined function curl_init() Does any one know what other line in apache php.ini i have to enable to get this to work ? Hope you can help. Quote Link to comment https://forums.phpfreaks.com/topic/163440-setup-curl-in-apache/ Share on other sites More sharing options...
Alex Posted June 23, 2009 Share Posted June 23, 2009 http://acmeous.blogspot.com/2009/02/how-to-enable-curl-support-for-php-in.html Quote Link to comment https://forums.phpfreaks.com/topic/163440-setup-curl-in-apache/#findComment-862345 Share on other sites More sharing options...
pkedpker Posted June 23, 2009 Share Posted June 23, 2009 honestly if this still relating to that POST method question.. then you see the problem.. many webhosts might also have it shutdown. anyways here is how it should be done <?php $data = "key=val&key2=val2&key3=val3&etc=etc.." $curl_handle = curl_init (); curl_setopt ($curl_handle, CURLOPT_URL, "https://site.com/postscript.php"); curl_setopt ($curl_handle, CURLOPT_FOLLOWLOCATION, 1); curl_setopt ($curl_handle, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($curl_handle, CURLOPT_POST, 1); curl_setopt ($curl_handle, CURLOPT_POSTFIELDS, $data); $response = curl_exec ($curl_handle) or die ("There has been an error connecting to your POST method site."); curl_close ($curl_handle); ?> Quote Link to comment https://forums.phpfreaks.com/topic/163440-setup-curl-in-apache/#findComment-862346 Share on other sites More sharing options...
EchoFool Posted June 23, 2009 Author Share Posted June 23, 2009 Thanks for the help guys ! Guna try and set it up and try that script ! Quote Link to comment https://forums.phpfreaks.com/topic/163440-setup-curl-in-apache/#findComment-862347 Share on other sites More sharing options...
EchoFool Posted June 24, 2009 Author Share Posted June 24, 2009 Right got it working but i get: There has been an error connecting to your POST method site. Is this down to the settigs on my other server? If so what do i need to allow it to work ? What could be stopping it ? Quote Link to comment https://forums.phpfreaks.com/topic/163440-setup-curl-in-apache/#findComment-862361 Share on other sites More sharing options...
EchoFool Posted June 24, 2009 Author Share Posted June 24, 2009 bump Quote Link to comment https://forums.phpfreaks.com/topic/163440-setup-curl-in-apache/#findComment-862430 Share on other sites More sharing options...
pkedpker Posted June 24, 2009 Share Posted June 24, 2009 Right got it working but i get: There has been an error connecting to your POST method site. Is this down to the settigs on my other server? If so what do i need to allow it to work ? What could be stopping it ? are u sure that site is real? https://site.com/postscript.php = example plus it has https which is SSL (secure sealed layer? i think) security site.. replace it with http://yoursite.com/YourScriptToPostTo.php Quote Link to comment https://forums.phpfreaks.com/topic/163440-setup-curl-in-apache/#findComment-862452 Share on other sites More sharing options...
EchoFool Posted June 24, 2009 Author Share Posted June 24, 2009 Yes the site is real as the site picked up the data perfectly... so it is working but i still get the error as mentioned Quote Link to comment https://forums.phpfreaks.com/topic/163440-setup-curl-in-apache/#findComment-862765 Share on other sites More sharing options...
EchoFool Posted June 24, 2009 Author Share Posted June 24, 2009 bump Quote Link to comment https://forums.phpfreaks.com/topic/163440-setup-curl-in-apache/#findComment-862882 Share on other sites More sharing options...
pkedpker Posted June 24, 2009 Share Posted June 24, 2009 try replace $response = curl_exec ($curl_handle) or die ("There has been an error connecting to your POST method site."); with $response = curl_exec ($curl_handle) or die ("The error was: ". curl_error($curl_handle)); Quote Link to comment https://forums.phpfreaks.com/topic/163440-setup-curl-in-apache/#findComment-862891 Share on other sites More sharing options...
EchoFool Posted June 25, 2009 Author Share Posted June 25, 2009 try replace $response = curl_exec ($curl_handle) or die ("There has been an error connecting to your POST method site."); with $response = curl_exec ($curl_handle) or die ("The error was: ". curl_error($curl_handle)); The error was: couldn't connect to host But it did connect to the script, because the script executed perfectly.. ? So any ideas what its on about? Quote Link to comment https://forums.phpfreaks.com/topic/163440-setup-curl-in-apache/#findComment-863501 Share on other sites More sharing options...
EchoFool Posted June 26, 2009 Author Share Posted June 26, 2009 bump =/ Quote Link to comment https://forums.phpfreaks.com/topic/163440-setup-curl-in-apache/#findComment-863859 Share on other sites More sharing options...
EchoFool Posted June 26, 2009 Author Share Posted June 26, 2009 bump Quote Link to comment https://forums.phpfreaks.com/topic/163440-setup-curl-in-apache/#findComment-864181 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.