I have the following piece of code which works on my remote server
$myCurl = curl_init();
curl_setopt_array($myCurl, array(
CURLOPT_URL => "http://{$_SERVER['HTTP_HOST']}/social/api/auth/login_or_register",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => http_build_query($credentials)
));
$exec = curl_exec($myCurl);
I decided to port the project to local for further development so I have set up a vagrant virtual machine with everything needs, everything seems to work normally except the piece of code above which gives me the following error:
Curl failed with error #7: Failed to connect to project.dev port 8000: Connection refused
Any hints on how I can work around this problem so that I can develop normally on local ?
add in /etc/hosts
127.0.0.1 project.dev
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With