Questions tagged [php-curl]

PHP cURL extension for HTTP requests

PHP supports libcurl, a library created by Daniel Stenberg, that allows you to connect and communicate to many different types of servers with many different types of protocols. libcurl currently supports the http, https, ftp, gopher, telnet, dict, file, and ldap protocols. libcurl also supports HTTPS certificates, HTTP POST, HTTP PUT, FTP uploading (this can also be done with PHP's ftp extension), HTTP form based upload, proxies, cookies, and user+password authentication.

These functions have been added in PHP 4.0.2.

Source

1306 questions
2
votes
2 answers

Fatal Error Call to undefined function curl_init()

I am aware that there are other questions with a similar title, such as the following: curl_init() function not working However I am still not able to get curl working on my localhost and on my server. For this case, I will focus on the server,…
John Beasley
  • 2,577
  • 9
  • 43
  • 89
2
votes
1 answer

Can not upload document via zoho api

Using curl request from Laravel. $path = storage_path('app/letters/letter.pdf'); $post = '@' . $path; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://sign.zoho.com/api/v1/requests'); $authorization = 'Authorization:…
rati_geo
  • 63
  • 5
2
votes
2 answers

PHP cURL not working but python request session is working

I want to write PHP for login in one website and this is my code: $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://www.daigger.com/account/access?redirect=%2f'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); …
user16050795
2
votes
0 answers

How To Modify REFERRER IN php USING curl_setopt and make a 301 redirect

I have been trying to set up a 301 redirect and setting the referrer with the domain where it is redirecting to. e.g https://my-site.com/goto.php?url=https://example.com/drake.mp3 the referrer will be https://example.com this is because the mp3…
2
votes
0 answers

Unexpected response from cURL API

I'm an absolute beginner when it comes to send an API request using cURL. I'm trying to get an access token. Everything seems to be fine when I'm testing my request with Reqbin: endpoint -> https://example.com/oauth/token method -> POST content type…
Davide
  • 87
  • 6
2
votes
0 answers

SSL certificate problem: unable to get local issuer certificate in postman

I create a curl request with PHP to call API from another server $ch=curl_init($url) ; curl_setopt($ch,CURLOPT_RETURNTRANSFER,1) ; $re=curl_exec($ch) ; echo curl_error($ch) ; curl_close($ch); but I got this error "SSL certificate problem:…
zohrehda
  • 625
  • 5
  • 10
2
votes
0 answers

Do not receive a response to some push-requests to the APNs server

I have about 45000 tokens for which I need to send a push notification. I send them via curl_multi_exec and get roughly 39000 responses from apple. Majority with status 200 (38650, eg), 300 with status 410 (Unregistered), 50 with status 0 and an…
2
votes
1 answer

Zoom API request to create meeting

Im sending a cURL request to ZOOM's EU api to create a meeting. My requests do not draw any response from the API at all, even errors or refusals. What am I missing? I have created a JWT App on Zoom's marketplace, from which I have gotten an API Key…
Eamonn
  • 1,338
  • 2
  • 21
  • 53
2
votes
1 answer

Why would simple PHP Curl https POST requests take more than 30 seconds to complete, from a Mac machine?

I am coding an API in PHP 7.2 to interface with a payment platform. I am doing that on a Mac (Catalina), and my project is reverse proxied by Nginx (Laravel Valet) on the Mac. The simplest Curl requests take forever to complete. Like, 36 seconds…
Eric
  • 243
  • 3
  • 9
2
votes
1 answer

Curl error: operation aborted by callback

So I have obviously googled the error - but PHP (PHP 7.4.4 (cli)) curl gives me the error: Curl error: operation aborted by callback with the following code: private function curl_post($url,$post,$file = null,$file_type = 'audio/wav'){ $ch =…
Antony
  • 3,875
  • 30
  • 32
2
votes
2 answers

Sending Data via cURL to External Order Management System

I am developing a theme for a client with woocommerce selling mobile phones wholesale. The client has an account with mobileshop.bz and they have their own system called NATM. I am able to import the products really easily but I need to find a way…
Phillip Dews
  • 338
  • 6
  • 25
2
votes
1 answer

How to download a generated pdf file with PHP?

I'm struggling to get a PDF file generated by an external server. Here is the link to the resource : https://www.test.colisprive.com/mcadesk/Externe/ShowEtiquettePDF.aspx/etiquette_colis-23-23000000000833300-PDF_DEFAUT-N/ So as you can see, no…
2
votes
1 answer

How to use laravel as proxy files between systems?

I need you help to find a way to be a 'proxy' between the frontend and a third-party software component using Laravel. The third-party software it is in my company's network and it generate the files on-demand. For sample, If i hit against…
Jhonatan Morais
  • 169
  • 1
  • 14
2
votes
1 answer

Connect to a site presenting an expired root certificate in the certificate bundle with curl in PHP

Over the weekend, the Sectigo AddTrust External CA Root expired. For modern browsers, this should not have made any difference for users of affected sites. Our PHP application connects to a site which we don't control, which includes this expired…
Dallin
  • 600
  • 3
  • 11
2
votes
1 answer

PHP curl_exec returns false & curl_error returns empty string

When attemtping to execute a get requests and fetch the answer body, curl_exec returns false and curl_error returns an empty string. The code is as follows : $curl = curl_init(); $opts = [ CURLOPT_URL => ' https://example.com'.…
Tim
  • 394
  • 2
  • 14