3

Is there a way to check if this is installed? Maybe something in phpinfo()?

I'm doing the call below and I don't get any reply at all. The page just ends when it gets to it.

        $postdata = array(
            'validation' => '1'
        );


        $response = http_post_data('../ajax/index_ajax_general.php', $postdata);
        print $response;
1
  • Where exactly is the script stopping? There aren't any errors or warnings showing? You can try putting error_reporting(E_ALL); in the beginning of your script to make sure errors and warnings are outputted. Also, there might be an error_log file in your script directory that could have any errors thrown by your script. Commented Dec 27, 2011 at 0:53

2 Answers 2

6

You could use

if (extension_loaded('pecl_http') == false) {
    // do not have extension
}

// or

if (function_exists('http_post_data') == false) {
    // function not available
}

Given that function is a PECL extension, you will probably find most PHP installations do not have these functions available.

Sign up to request clarification or add additional context in comments.

Comments

0

As far as I can see from the documentation this function requires at least PHP v5.0: http://www.php.net/manual/en/http.requirements.php

If you don't get an error like "undefined function ..." the function is available and something with your code is wrong...

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.