I am trying to execute curl command from php using exec() function but it gives me that error
curl: (7) couldn't connect to host
This is my code:
$command = "curl http://localhost:6821/schedule.json
-d project=default -d search=".$_POST["search_type"]."
-d url='".$url_info["url"]."' -d domain='".$domain."' -d
city='".$url_info["city"]."' -d state='".$url_info["state"]."' 2>&1";
$return = exec($command);
echo $return;
I am beginner with curl. I search and found there is a php library could perform curl command functionality but I don't know how to transfer this command line to php code using the curl library.