Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6618137
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:47:26+00:00 2026-05-25T20:47:26+00:00

I found some PHP code on the ‘net that supposedly will help me send

  • 0

I found some PHP code on the ‘net that supposedly will help me send some text from my web site to be posted in a twitter feed.

However, it just dies on the curl_init() part. The browser shows an empty page (no HTML content whatsoever), and the code stops executing.

Here is the code:

$url = 'http://twitter.com/statuses/update.xml';
$curl_handle = curl_init();
curl_setopt($curl_handle, CURLOPT_URL, "$url");
curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 2);
curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl_handle, CURLOPT_POST, 1);
curl_setopt($curl_handle, CURLOPT_POSTFIELDS, "status=$body");
curl_setopt($curl_handle, CURLOPT_USERPWD, "$username:$password");
$buffer = curl_exec($curl_handle);
curl_close($curl_handle);

I am testing on Ubuntu 11.04, using NetBeans (yes, I know Netbeans is designed for Java debugging, but it’s free and has a very good PHP debugging plugin) with xdebug. I’m testing on a local Apache 2.2 server.

I’ve tried running the debugger to see where it fails, and the debugger also bails when the code hits the curl_init() part. It simply exits the debugger, and the browser, as mentioned above, shows only an empty page.

Is there something I need to configure or do to get curl_init() to actually do stuff?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T20:47:27+00:00Added an answer on May 25, 2026 at 8:47 pm

    Most probably the curl module is not installed or enabled in your PHP setup. You can check for this in various ways:

    • see if extension_loaded('curl') (as mentioned in that page, you can do the same from the command line with the php -m command but be careful — I have see installations where command line PHP was using a different php.ini that the Apache module!)
    • see if function_exists('curl_init')
    • check the output of phpinfo()
    • inspect php.ini

    If curl is not installed (as it sounds like), install it and your problem is solved.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have found some code on measuring execution time here http://www.dreamincode.net/forums/index.php?showtopic=24685 However, it does
I have found some libraries or web services in PHP that does the job.
I've been looking for some guidelines on how to layout PHP code. I've found
I found some code in a project which looks like that : int main(int
I found some mapkit code on the internet that looks like this: - (void)recenterMap
I was reading some php code source and found the following: $failed |= is_numeric(
I found some code to help me with an issue I was having..it is
I found some jQuery code as a result of a Google search that allowed
Found some old code, circa VS 2003. Now I have just VS 2008 (SP1)
Am I doing this right? I went to look at some old PHP code

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.