hyc wrote:$ch = curl_init($urltest);
and correctly got an error displayed on top
But what has you set $urltest to? That would have to be an URL.
Ultimately, the problem would likely be that your cURL doesn't trust requests to EXTERNAL hosts (eg. not on your server). I say that because it's not unusual for cURL to be blocked like this, and it's a logical precaution. You could test this yourself by setting up a local PHP script to 1. load a local file /test.txt by cURL and 2. load a file from a remote website
https://somewebsite.com/test.txt by cURL. Likely, first will succeed and second will fail. If not even the local request works, then you have a bigger problem, but that is highly unlikely as long as the file is available by request.
https://www.php.net/manual/en/curl.examples-basic.php
https://startutorial.com/view/php-curl
hyc wrote:how to test that "It could also be something abstract, for example if your system clock is not accurate, the SSL verification will fail for the requested https url." ?
That was just an example to propose it could be something we simply don't know. First you would do the test above and make sure cURL works at least for LOCAL files. Then you could try to make a request to a NON-HTTPS server for a file
http://somewebsite.com/test.txt ... I doubt this is related.
hyc wrote:i am behind cloudflare (only DNS, not proxied) and I have a docker
Can't see how this is related.
hyc wrote:could it MAYBE be related to ownership/folder permissions ?
I can't see how this is related either. CURL requests will read the REMOTE server (if the local cURL allows it). It could only be related if you for some reason are not allowed to write the files that are downloaded, but that wouldn't trigger an error in the cURL request.
Ultimately, I don't know enough about this, sorry. The reason I mention the "remote url" issue, is because it's NORMAL for many hosts to BLOCK cURL requests to external url's. WHY? Because external cURL requests could be used by malicious scripts to download malicious content to the server. I would guess that the same mechanism that does this, is in place on your server. In conclusion, your cURL refuses to download from remote server, and this needs to be resolved ... I really can't know why that happens on your server, but it is not unusual.