Tag: cURL

How to download a file from a URL and save it on my server (how to avoid running out of RAM when downloading large files)

In PHP, you can download a file via a link (URL) and save it on your server in several ways. Some of them have important differences that can be key when choosing a way to download and save a file in PHP. 1. file_get_contents and file_put_contents The first very obvious option is to use file_get_contents and file_put_contents: file_put_contents("Tmpfile.zip", file_get_contents("http://someurl/file.zip")); Real...

Redirect to HTTPS not working in WordPress

This is not an obvious problem, because for some pages the redirect to HTTPS works, but for some it does not. I ran into this problem on WordPress quite by accident. Therefore, if you are a webmaster with WordPress sites, then I would recommend that you check your sites too. Redirecting from HTTP to HTTPS is quite simple, you need...

Error “curl: (1) Received HTTP/0.9 when not allowed” (SOLVED)

cURL is a popular command line utility that supports many network protocols. curl supports HTTP with numerous options and variations. It can speak HTTP version 0.9, 1.0, 1.1, 2 and 3 depending on build options and the correct command line options. But when the remote host does respond with HTTP/0.9, curl fails with an error that HTTP/0.9 is not allowed,...
Loading...
X