skip to Main Content

curl works in CLI, but not in PHP – Nginx

curl works in CLI, but not in PHP. The following command works in the command line: curl -X POST --header "Content-Type: application/json" --header "Authorization: Basic [token]" https://api.example.com/v1/token -v -k * About to connect() to api.example.com port 443 (#0) .. >…

VIEW QUESTION

how install curl php in centos

i'm trying to install curl to my centos OS by yum when I check curl --version it shows curl 7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.44 zlib/1.2.3 libidn/1.18 libssh2/1.4.2 Protocols: tftp ftp telnet dict ldap ldaps http file https ftps scp sftp Features:…

VIEW QUESTION

Php versions – How to upload files with POST form-data in PHP?

The normal curl way, works well. curl -F "[email protected]" -H "Content-Type: multipart/form-data" https://sm.ms/api/v2/upload But in my PHP version curl, it returns bool(false) and string(0) "": <?php $url = "https://sm.ms/api/v2/upload"; $headers = array(); array_push($headers, "Content-Type: multipart/form-data"); array_push($headers, "User-Agent: ".$_SERVER['HTTP_USER_AGENT']); // $fields…

VIEW QUESTION
Back To Top
Search