PHP POST not working, what module to enable

59

I want to make a PHP POST request from my new VPS server to another IP address. I checked the firewall and everything seemed fine but the request never went to the other IP, so I then tried making the same request with node.js and it went through. The question is, what PHP module/extension do I need to enable to allow php requests with or without curl.

A simple CURL request:

$ch = curl_init();
$url='http://example.com/';

curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$server_output = curl_exec ($ch);
curl_close ($ch);

People are also looking for solutions to the problem: html - 500 Error When Attempting to Echo Form data in PHP

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.