I’m trying to fetch the contents of a page using CURL. The page that is doing the fetching is https and the page it is trying to fetch is also https. I’m getting an error «Couldn’t resolve host» with all of the settings I try.
$c=curl_init();
curl_setopt($c, CURLOPT_URL,$url);
//curl_setopt($c, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:x.x.x) Gecko/20041107 Firefox/x.x");
curl_setopt ($c, CURLOPT_RETURNTRANSFER, TRUE);
//curl_setopt($c, CURLOPT_SSL_VERIFYPEER, TRUE);
//curl_setopt($c, CURLOPT_SSL_VERIFYHOST, TRUE);
curl_setopt($c, CURLOPT_HEADER, FALSE);
$html=curl_exec($c);
if($html === false) {
echo curl_error($c);
}
else {
echo 'Operation completed without any errors';
}
curl_close($c);
Any ideas?
asked Aug 27, 2009 at 14:57
2
I found that curl can decide to use IPv6, in which case it tries to resolve but doesn’t get an IPv6 answer (or something to that effect) and times out.
You can try the curl command line switch -4 to test this out:
curl -4 http://x.com
In PHP, you can configure this line by setting this:
curl_setopt($c, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
Official manual page for this option: https://curl.se/libcurl/c/CURLOPT_IPRESOLVE.html
answered Apr 25, 2013 at 20:58
Jacob BruinsmaJacob Bruinsma
1,0671 gold badge10 silver badges23 bronze badges
13
Maybe a DNS issue?
Try your URL against this code:
$_h = curl_init();
curl_setopt($_h, CURLOPT_HEADER, 1);
curl_setopt($_h, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($_h, CURLOPT_HTTPGET, 1);
curl_setopt($_h, CURLOPT_URL, 'YOUR_URL' );
curl_setopt($_h, CURLOPT_DNS_USE_GLOBAL_CACHE, false );
curl_setopt($_h, CURLOPT_DNS_CACHE_TIMEOUT, 2 );
var_dump(curl_exec($_h));
var_dump(curl_getinfo($_h));
var_dump(curl_error($_h));
answered Aug 27, 2009 at 15:05
KB22KB22
6,7898 gold badges42 silver badges52 bronze badges
6
I had the same problem. Coudn’t resolve google.com. There was a bug somewhere in php fpm, which i am using. Restarting php-fpm solved it for me.
answered Aug 12, 2015 at 15:52
TecBeastTecBeast
9208 silver badges15 bronze badges
5
Just a note which may be helpful- I was having this trouble with Apache on my laptop (which connects by wifi AFTER startup), and restarting the server (after connect) fixed the issue. I guess in my case this may be to do with apache starting offline and perhaps there noting that DNS lookups fail?
answered Nov 24, 2010 at 10:08
RickRick
931 silver badge5 bronze badges
1
There is a current bug in glibc on Ubuntu which can have this effect:
https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/1674733
To resolve it, update libc and all related (Packages that will be upgraded: libc-bin libc-dev-bin libc6 libc6-dev libfreetype6 libfreetype6-dev locales multiarch-support) and restart the server.
answered Mar 22, 2017 at 14:41
We need to add host security certificate to php.ini file. For local developement enviroment we can add cacert.pem in your local php.ini.
do phpinfo(); and file your php.ini path open and add uncomment ;curl.capath
curl.capath=path_of_your_cacert.pem
answered Aug 30, 2016 at 9:12
PrincePrince
312 silver badges6 bronze badges
1
If you do it on Windows XAMPP/WAMP it probaly won’t work as in my case.
I solved the problem setting up Laravel’s Homestead/Vagrant solution to create my (Ubuntu) development environment — it has built-in: Nginx, PHP 5.6, PHP 7.3, PHP 7.2, PHP 7.1, MySQL, PostgreSQL, Redis, Memcached, Node… to name just a few.
See here for info how to set up the environment — it’s really worth the effort!
Laravel Homestead is an official, pre-packaged Vagrant box that provides you a wonderful development environment without requiring you to install PHP, a web server, and any other server software on your local machine. No more worrying about messing up your operating system! Vagrant boxes are completely disposable. If something goes wrong, you can destroy and re-create the box in minutes!
Then you can easily switch PHP versions or set up more virtual hosts, new databases just in seconds.
answered Jan 18, 2019 at 11:01
PicardPicard
3,5153 gold badges43 silver badges48 bronze badges
After tried all above, still can’t resolved my issue yet.
But got new solution for my problem.
At server where you are going to make a request, there should be a entry of your virtual host.
sudo vim /etc/hosts
and insert
192.xxx.x.xx www.domain.com
The reason if you are making request from server to itself then, to resolve your virtual host or to identify it, server would need above stuff, otherwise server won’t understand your requesting(origin) host.
answered Jun 13, 2019 at 12:40
Jigar7521Jigar7521
1,52914 silver badges26 bronze badges
Your getting the error because you’re probably doing it on your Local server environment. You need to skip the certificates check when the cURL call is made. For that just add the following options
curl_setopt($c, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($c, CURLOPT_SSL_VERIFYHOST, 0);
answered Jan 6, 2016 at 12:10
You may have to enable the HTTPS part:
curl_setopt($c, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($c, CURLOPT_SSL_VERIFYHOST, 2);
And if you need to verify (authenticate yourself) you may need this too:
curl_setopt($c, CURLOPT_USERPWD, 'username:password');
answered Aug 27, 2009 at 15:04
Mr. SmithMr. Smith
5,41910 gold badges42 silver badges60 bronze badges
0
add yourlocalhost
ex. 127.0.0.1 cards.localhost
in the /etc/hosts directory.
Now restart apache server
answered Nov 22, 2017 at 8:44
sunilsunil
11 bronze badge
2
As Linux users continue to skillfully nurture and grow their user experience, they soon realize that they become more performant and productive while in the Linux command-line environment.
The Linux OS environment exposes its users to terminal-based tools like Curl for a non-interactive download and upload of targeted network/internet-based files, which is similar to the Wget utility and both share some similarities in their implementation and functionalities.
The primary role of the Curl utility as highlighted on its manual page is to transfer a targeted URL.
$ man curl
It supports numerous protocols with the common ones being FTP, FTPS, HTTP, HTTPS, SCP, SFTP, SMTP, and SMTP.
The Curl command syntax is as follows:
$ curl [options / URLs]
We can show its implementation by using it with a random URL.
$ curl https://google.com -o linuxshelltips.txt
In the above command, Curl’s findings from accessing the highlighted URL are saved in the succeeding text file.
curl: (6) could not resolve host Error
Mostly, such an error occurs when there is an issue with a Linux server’s DNS resolver. A Linux administrator will categorize/define this challenge as a server management service issue.
This error is likely to take several forms when the curl command is executed from the Linux terminal and the most popular ones include:
- curl: (6) could not resolve host: domain_name.extension; Name or service not known
- curl: (6) could not resolve host: domain_name.extension e.g. linuxshelltips.com
- curl: (6) could not resolve host: application
Now that we have highlighted the primary reason that might be behind the stated curl command error during its execution on a Linux terminal, it’s time to fix the problem.
Solution 1: Missing Working DNS Nameserver
A nameserver is basically a bridge between a working/purchased domain name and the IP address of a server. When you purchase or subscribe to a domain name, and before you use/link this domain name to your remote Linux server, you need to configure a DNS nameserver. A DNS nameserver enables a user to use a domain name to access a remote server instead of using its IP address.
On your Linux server/machine, the file /etc/resolv.conf is responsible for the DNS nameserver entries auto-generated by NetworkManager.
$ sudo nano /etc/resolv.conf
This file can hold more than one DNS nameserver entry. As you might have noted, the syntax for adding a DNS nameserver entry in this file should resemble the following:
nameserver IP.ADDRESS
For instance, if you were to add Google public nameservers to this file, it would look like the following:
nameserver 192.168.100.1 nameserver 8.8.8.8 nameserver 8.8.4.4
If you are using a private DNS nameserver, add it to the /etc/resolv.conf file. Update or reboot the system if possible and the host should start resolving.
Solution 2: Curl Syntax Errors
Make sure the curl command execution adheres to its correct syntax usage. A syntax error can arise from something as simple as the misuse of an escape sequence (/)
or an illegal spacing on the URL.
The curl: (6) could not resolve host error in Linux primarily relates to wrongful/missing DNS nameserver setup or a random syntax error that can be scanned and fixed.
Are you curious to know why does the error ‘curl (6) could not resolve host ubuntu’ appear?
Usually, such curl errors happen when there are problems with DNS resolvers on the server.
At Bobcares, we often get requests from our customers to fix curl (6) could not resolve host Ubuntu as part of our Server Management Services.
Today, let’s discuss why this error occurs and see how our Support Engineers fix it.
What is curl (6) could not resolve host?
Many of our customers have experienced this error ‘curl (6) could not resolve host’ while trying to connect to a webpage from the terminal.
This error mainly occurs due to a wrong DNS set up or bad settings on the server.
Also, we’ve seen this error appearing in different ways which include.
- curl: (6) Could not resolve host: application
- curl: (6) Could not resolve host: domain.com
- curl: (6) Could not resolve host: google.com; Name or service not known
This essentially means the server was not able to connect to the remote host.
How we fixed the error curl (6) could not resolve host in ubuntu
At Bobcares, where we have more than a decade of expertise in managing servers, we see many customers face problems while managing a server.
Now, let’s see the major reasons for curl errors and how our Support Engineers fix this error.
1. Missing working DNS nameserver
Sometimes, users may receive a problem when trying to install packages like wget, apt-get not being able to resolve hosts.
For example, when executing a command apt-get install wget.
Users may get an error as curl#6 - "Could not resolve host: repo.xxx.com; Unknown error"
This mainly occurs when we don’t have nameservers in the /etc/resolv.conf
So, we added the following line in the file.
nameserver 8.8.8.8
Then, this fixed the error and the host started resolving.
2. Syntax error
Recently, one of our customers had a problem while executing the command curl on his terminal. He used the command as below,
curl -X 'GET https://www.mywebsite.com/Web2/PDF.aspx?page=1'
Also, the error said Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.119 Safari/537.36 OPR/51.0.2830.26'
curl: (6) Could not resolve host:
On checking, our Support Engineers found that the error was due to the incorrect syntax used to access the website.
So, we corrected the syntax as below. This happened as he had included space after one of the / escape sequences.
curl -X GET https://www.mywebsite.com/Web2/PDF.aspx?page=1/
Similarly, an error happened when running the following command
curl -i -H 'Content-Type: application/json' -d '{"Code":"FR","Name":"France"}' http://127.0.0.1:8080/countries
The error said Curl: (6) Could not resolve host: application.
This error was also due to the syntax error in the command. Thus, we resolved this problem editing like this in windows:
"{/"Code/":/"FR/"}"
In another case, we corrected it by deleting an extra space from the command.
curl -H Content-Type:application/json ~
Finally, this fixed the error.
[Need more help to solve curl error?- We’ll fix it for you.]
Conclusion
In short, an error curl (6) could not resolve host on ubuntu happens due to syntax error or due to the wrong DNS set up. Today, we saw how our Support Engineers assisted our customers to solve this error.
PREVENT YOUR SERVER FROM CRASHING!
Never again lose customers to poor server speed! Let us help you.
Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.
GET STARTED
var google_conversion_label = «owonCMyG5nEQ0aD71QM»;
Getting this error message when trying to work with passport in my project on my local server.
CurlFactory.php line 186:
cURL error 6: Could not resolve host: api.project.local (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)
{
"token_type": "Bearer",
"expires_in": 518399,
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6Ijk0MWU3Y2Q2Y2I1ZTEyYmYyYzAzYTIzY2I1YWM5YjY3YjI0MmU2NTUwOWRhODVlZTMxNzc3MjIwODA3ZTA2ZGY1YWIwYjMzNDg2MDA2MTZlIn0.eyJhdWQiOiIxIiwianRpIjoiOTQxZTdjZDZjYjVlMTJiZjJjMDNhMjNjYjVhYzliNjdiMjQyZTY1NTA5ZGE4NWVlMzE3NzcyMjA-rkLpvJhuju4Qlo0QNjsXUUHXq6GyqqiQTNa2d0IUsWdAOSLsy1bMu4Z2ga_Jj1L1ThwbDOfy7kE4_5SDfKKIyKXO_-iw",
"refresh_token": "L8p2NAqRZfi1fP1XyO3NW36dCqa6HZJWgNKkuR8IMz2LJe5711nRHPMP734caln1+8m+GC6K79yTjRjru01iR7LKP1CCseixQ8mkzXWZb+roQv32qdkXVSeCzObecOI2ZWq+l1KNs12NA3KIZJ4bS0N2rOYxlw3KTNx55uydH13vmanbeXIpym0ha8op0M9s9HvwPc+dJUhjL20JzDGCcyuhciGIe6CTKyBuqi4dNA8tIeALLPSSqtvd0QsRWCWTVBL72RVeEeIq/4kFppE="
}
install laravel 5.3
install passport package
extract laravel auth scaffold to app directory.
put this line of code inside of authentication controller when user is logged in :
path = Project/app/Foundation/Auth/AuthenticatesUsers.php
$http = new Client;
$response = $http->post('Project.local/oauth/token', [
'form_params' => [
'grant_type' => 'password',
'client_id' => 1,
'client_secret' => 'xKqNbzcXyjySg20nVuVLw5nk5PAMhFQOQwRTeTjd',
'username' => $userobject['email'],
'password' => $userobject['password'],
'scope' => '',
],
]);
On some servers it works, on some it doesn’t and I don’t know what is the cause. the server I’m facing problem right now is ubuntu14.04 server with php5.6 and apache2 and mysql5.5
Curl: (6) could not resolve host – What’s wrong?
If you are using Linux, you are not too unfamiliar with Terminal, which is a software program that allows the user to communicate with the computer by running pre-installed commands. When you are trying to install a new application for using Terminal, you may get the error Curl: (6) could not resolve host.
If you are facing the error Curl: (6) could not resolve host, there may be 2 reasons for that. First of all, IPV6 was enabled. And another one is the wrong DNS server. So, if you are troubled because of one of the two reasons above, we will bring you the ways to disable IPV6 and add a Google DNS server to deal with this error. Let’s get started now!
How to fix Curl: (6) could not resolve host
As we mentioned above, the first solution we will show you is how to disable IPV6 to solve the error Curl: (6) could not resolve host. Here is the detailed instruction:
- Open Terminal -> Type su and enter in order to log in as the super user.
- Fill out the root password.
- Change the directory cd/etc/modprobe.d/ to /etc/modprobe.d/
- Type vi disableipv6.conf and generate a new file.
- Press the combination key Esc + I to insert data into the file you have already created.
- Enter install ipv6 /bin/true on the file in order to avoid loading modules related to IPV6.
- Type Esc + : -> Type wp to save and exit.
- Enter reboot to restart fedora -> Open terminal -> Type lsmod | grep ipv6
- Now, if there is no result, you succeed in disabling IPV6.
The second method to deal with this error Curl: (6) could not resolve host is to add Google DNS server. Let’s follow the steps below:
- Open Terminal -> Type su and enter in order to log in as the super user.
- Fill out the root password.
- In order to check what DNS server you are using, let’s type cat /etc/resolv.conf.
- An open DNS server maintained by Google can help you to address this trouble. They are 8.8.8.8 and 8.8.4.4 but they may change in the future. Learn more here.
- Enter vi /etc/resolv.conf in order to modify the file resolv.conf.
- Press the combination key Esc + I to insert data into the file.
- Insert # at the beginning of each line -> Fill out the two following lines in the file:
nameserver 8.8.8.8
nameserver 8.8.4.4
- Type Esc + : -> Type wp to save and exit.
Everything is done and you don’t need to restart. The error will disappear now!
Conclusion
To sum up, they are the two helpful solutions that are rated by many users. So, we hope that they will also support you to tackle the error Curl: (6) could not resolve host effectively. If you have any questions, please leave your comment below and we will answer you as soon as possible.
Furthermore, if you are finding some fast-loading speed, SEO-friendly and responsive free WordPress themes and Joomla 4 Templates, don’t hesitate to visit our site and explore the collection.
- Author
- Recent Posts
Welcome to LT Digital Team, we’re small team with 5 digital content marketers. We make daily blogs for Joomla! and WordPress CMS, support customers and everyone who has issues with these CMSs and solve any issues with blog instruction posts, trusted by over 1.5 million readers worldwide.
I have a CentOS 7.3 machine that is a guest running on Oracle VirtualBox. The host is a Windows machine. I can ping 8.8.8.8 from the Linux server. The Linux server can ping itself by its hostname ping coolvm
. As root I recently did a yum -y update
command. That is when curl stopped working. FQDNs will not resolve.
If I try this:
curl -v http://www.google.com
I get this error:
- Could not resolve host: www.google.com; Unknown error
- Closing connection 0 curl: (6) COuld not resolve host: www.google.com; Unknown error
The commands nslookup, dig and host have not been installed. I cannot install new Yum packages because I get an error related to host resolution («Resolving time out»).
The /etc/resolv.conf file looks like this:
# Generated by NetworkManager
search localdomain
nameserver 8.8.8.8
nameserver 8.8.4.4
I tried rebooting the host machine (and thus the guest too). But that did not help me. Browsing the internet has not changed.
The interface for the main NIC in /etc/sysconfig/network-scripts/ has DNS server stanzas that have worked in the past. The interface file is standard and complete. I have not changed it since the yum -y update
command.
How can I get FQDNs to resolve? I want to use the Lynx command. My repositories rely on FQDNs to resolve. I cannot use yum to install packages.
Update. I ran this command:
cat /etc/nsswitch.conf | grep -i hosts
I saw this:
#hosts: db files nisplus nis dns
hosts: files dns myhostname
Буквально пару дней назад переносили сайт на WordPress на обновленный сервер, и столкнулись с проблемой установки обновлений и новых плагинов. Если поискать в интернете, видно, что люди часто сталкиваются с такой ошибкой и предлагается всего 2 варианта решения:
- Подождите, может, само рассосется
- Обратитесь к системному администратору
Ждать — не вариант. Если вы используете виртуальный хостинг одного из хостеров, то техподдержка должна решить эту проблему достаточно быстро. А если вы арендовали VPS и сами себе администратор, то информация ниже поможет вам решить проблему.
Как проявляется ошибка
Ошибка возникает при попытке установить обновление WordPress, обновить темы оформления или установить новый плагин. При этом появляется сообщение «Warning: Произошла непредвиденная ошибка. Возможно, что-то не так с сайтом WordPress.org или с настройками вашего сервера. Если проблема не решится, обратитесь на форумы поддержки. (Не удалось установить защищённое соединение с WordPress.org. Пожалуйста, свяжитесь с администратором сервера)».
В логах сервера фигурируют следующие файлы, в которых возникает ошибка:
/wp-admin/includes/plugin-install.php
/wp-admin/includes/translation-install.php
/wp-admin/includes/update.php
/wp-includes/update.php
Если у вас установлен плагин Health Check & Troubleshooting (кстати, настоятельно рекомендую его установить), то в отчете можно увидеть ошибки вида
cURL error 6: Could not resolve host: api.wordpress.org
Очевидно, что проблема в библиотеке cURL, либо настройках сервера.
Как решить проблему
Нам понадобится доступ к серверу по протоколу SSH и права администратора для внесения изменений в настройки и установки ряда библиотек.
1. Проверяем настройки в файле php.ini
Обычно этот файл находится в папке /etc/php.ini или /etc/php/<версия php>/apache2/php.ini. Убедитесь, что эти две настройки включены:
allow_url_fopen = On
allow_url_include = On
2. Проверяем установку необходимых библиотек с помощью phpinfo()
Создайте на своем сервере файл pi.php в корне сайта со следующим содержимым:
<?php
phpinfo();
Откройте файл в браузере http://<адрес сервера>/pi.php и проверьте, что следующие библиотеки установлены в Enabled
OpenSSL
Socket
3. Проверяем файл resolv.conf
Файл можно найти по адресу /etc/resolv.conf — воспользуйтесь привычным текстовым редактором. Удалите из файла все комментарии, укажите используемые DNS-сервера (рекомендую Google, но вы можете выбрать те, которые нравятся):
nameserver 8.8.8.8
nameserver 8.8.4.4
Сохраните изменения и закройте редактор. Убедитесь, что файл доступен для всех пользователей:
chmod a+r /etc/resolv.conf
4. Если вы используете высокоэффективную связку nginx + php-fpm
Для начала проверяем конфигурацию php-fpm для вашего сайта. Ее можно найти в /etc/php-fpm.d/<имя сайта>.conf. Откройте файл и найдите строку
chroot = <путь к песочнице>
Если строка присутствует и не закомментирована, значит php-fpm работает в режиме chroot, и вам потребуется скопировать часть файлов системы в chroot-окружение, т.к. у php-fpm нет к ним доступа. Для этого переходим в папку, указанную в chroot и выполняем следующие команды:
mkdir etc
mkdir lib64
mkdir usr
mkdir usr/share
cp -p /etc/hosts etc/
cp -p /etc/localtime etc/
cp -p /etc/resolv.conf etc/
cp -p /lib64/libss_dns* lib64/
cp -Rp /usr/share/zoneinfo usr/share/
После выполнения указанных действий перезапускаем php-fpm, и проблема решена.
systemctl restart php-fpm
Если вам требуется сопровождение VPS/VDS-сервера или помощь с настройкой, обратитесь к нам, мы занимаемся настройкой и сопровождением серверов с 2013 года. Порекомендуем хостера, подберем конфигурацию и поможем запустить ваш проект.
« Previous
Next »
Error: Error downloading packages: Curl error (6): Couldn’t resolve host name for https://mirrors.fedoraproject.org/metalink?repo=updates-released-f25&arch=x86_64 [Could not resolve host: mirrors.fedoraproject.org]
$ sudo dnf install python
When installing python package, this error is raised (Curl error (6): Couldn’t resolve host name for https://mirrors.fedoraproject.org/metalink?repo=updates-released-f25&arch=x86_64)
How to resolve could not resolve host name issue?
Try running this commands
$ sudo dnf clean all
$ sudo dnf upgrade
Check whether output of the upgrade command is ‘Error: Failed to synchronize cache for repo ‘fedora»
Try ping command for host mirrors.fedoraproject.org
$ ping mirrors.fedoraproject.org
Output:
ping: mirrors.fedoraproject.org: Temporary failure in name resolution
Try few times if ping is not working and displayed as above and instead of getting reply.
PING wildcard.fedoraproject.org (67.219.144.68) 56(84) bytes of data. 64 bytes from 67.219.144.68 (67.219.144.68): icmp_seq=1 ttl=50 time=367 ms 64 bytes from 67.219.144.68 (67.219.144.68): icmp_seq=2 ttl=50 time=307 ms
Try upgrade command also few times if not working, sometimes connection with host ‘mirrors.fedoraproject.org’ might be temporarily failed.
$ sudo dnf upgrade
Output:
Upgrades all the packages.
« Previous
Next »
Below is the list of all cURL errors and the reasons behind these errors.
- Ok
- Unsupported Protocol
- Failed Init
- URL Malfomat
- Not Built In
- Couldn’t Resolve Proxy
- Couldn’t resolve host
- Couldn’t connect
- Weird server reply
- Remote access denied
- FTP accept failed
- FTP weird pass reply
- FTP accept timeout
- FTP weird pasv reply
- FTP weird 227 format
- FTP cant get host
- HTTP2
- FTP couldnt set type
- Partial file
- FTP couldnt retr file
- Quote error
- HTTP returned error
- Write error
- Upload failed
- Read error
- Out of memory
- Operation timedout
- FTP port failed
- FTP couldnt use rest
- Range error
- HTTP post error
- SSL connect error
- Bad download resume
- File couldnt read file
- LDAP cannot bind
- LDAP search failed
- Function not found
- Aborted by callback
- Bad function argument
- Interface failed
- Too many redirects
- Unknown option
- Telnet option syntax
- Got nothing
- SSL engine notfound
- SSL engine setfailed
- Send error
- Recv error
- SSL certproblem
- SSL cipher
- PEER failed verification
- Bad content encoding
- LDAP invalid url
- Filesize exceeded
- Use ssl failed
- Send fail rewind
- SSL engine initfailed
- Login denied
- TFTP notfound
- TFTP perm
- Remote disk full
- TFTP illegal
- TFTP unknownid
- Remote file exists
- TFTP nosuchuser
- Conv failed
- Conv reqd
- SSL cacert badfile
- Remote file not found
- SSH
- SSL shutdown failed
- Again
- SSL crl badfile
- SSL issuer error
- FTP pret failed
- RTSP cseq error
- RTSP session error
- FTP bad file list
- Chunk failed
- No connection available
- SSL pinnedpubkeynotmatch
- SSL invalidcertstatus
- HTTP2 stream
- Recursive api call
- Auth error
- HTTP3
- Quic connect error
- Obsolete*
Ok Ok
CURL error code 0 – CURLE_OK (0)
All fine. Proceed as usual.
Top ↑
Unsupported Protocol Unsupported Protocol
CURL error code 1 – CURLE_UNSUPPORTED_PROTOCOL (1)
The URL you passed to libcurl used a protocol that this libcurl does not support. The support might be a compile-time option that you didn’t use, it can be a misspelled protocol string or just a protocol libcurl has no code for.
Top ↑
Failed Init Failed Init
CURL error code 2 – CURLE_FAILED_INIT (2)
Very early initialization code failed. This is likely to be an internal error or problem, or a resource problem where something fundamental couldn’t get done at init time.
Top ↑
URL Malfomat URL Malfomat
CURL error code 3 – CURLE_URL_MALFORMAT (3)
The URL was not properly formatted.
Top ↑
Not Built In Not Built In
CURL error code 4 – CURLE_NOT_BUILT_IN (4)
A requested feature, protocol or option was not found built-in in this libcurl due to a build-time decision. This means that a feature or option was not enabled or explicitly disabled when libcurl was built and in order to get it to function you have to get a rebuilt libcurl.
Top ↑
Couldn’t Resolve Proxy Couldn’t Resolve Proxy
CURL error code 5 – CURLE_COULDNT_RESOLVE_PROXY (5)
Couldn’t resolve proxy. The given proxy host could not be resolved.
Top ↑
Couldn’t resolve host Couldn’t resolve host
CURL error code 6 – CURLE_COULDNT_RESOLVE_HOST (6)
Couldn’t resolve host. The given remote host was not resolved.
Top ↑
Couldn’t connect Couldn’t connect
CURL error code 7 – CURLE_COULDNT_CONNECT (7)
Failed to connect() to host or proxy.
Top ↑
Weird server reply Weird server reply
CURL error code 8 – CURLE_WEIRD_SERVER_REPLY (8)
The server sent data libcurl couldn’t parse. This error code was known as as CURLE_FTP_WEIRD_SERVER_REPLY before 7.51.0.
Top ↑
Remote access denied Remote access denied
CURL error code 9 – CURLE_REMOTE_ACCESS_DENIED (9)
We were denied access to the resource given in the URL. For FTP, this occurs while trying to change to the remote directory.
Top ↑
FTP accept failed FTP accept failed
CURL error code 10 – CURLE_FTP_ACCEPT_FAILED (10)
While waiting for the server to connect back when an active FTP session is used, an error code was sent over the control connection or similar.
Top ↑
FTP weird pass reply FTP weird pass reply
CURL error code 11 – CURLE_FTP_WEIRD_PASS_REPLY (11)
After having sent the FTP password to the server, libcurl expects a proper reply. This error code indicates that an unexpected code was returned.
Top ↑
FTP accept timeout FTP accept timeout
CURL error code 12 – CURLE_FTP_ACCEPT_TIMEOUT (12)
During an active FTP session while waiting for the server to connect, the CURLOPT_ACCEPTTIMEOUT_MS (or the internal default) timeout expired.
Top ↑
FTP weird pasv reply FTP weird pasv reply
CURL error code 13 – CURLE_FTP_WEIRD_PASV_REPLY (13)
libcurl failed to get a sensible result back from the server as a response to either a PASV or a EPSV command. The server is flawed.
Top ↑
FTP weird 227 format FTP weird 227 format
CURL error code 14 – CURLE_FTP_WEIRD_227_FORMAT (14)
FTP servers return a 227-line as a response to a PASV command. If libcurl fails to parse that line, this return code is passed back.
Top ↑
FTP cant get host FTP cant get host
CURL error code 15 – CURLE_FTP_CANT_GET_HOST (15)
An internal failure to lookup the host used for the new connection.
Top ↑
HTTP2 HTTP2
CURL error code 16 – CURLE_HTTP2 (16)
A problem was detected in the HTTP2 framing layer. This is somewhat generic and can be one out of several problems, see the error buffer for details.
Top ↑
FTP couldnt set type FTP couldnt set type
CURL error code 17 – CURLE_FTP_COULDNT_SET_TYPE (17)
Received an error when trying to set the transfer mode to binary or ASCII.
Top ↑
Partial file Partial file
CURL error code 18 – CURLE_PARTIAL_FILE (18)
A file transfer was shorter or larger than expected. This happens when the server first reports an expected transfer size, and then delivers data that doesn’t match the previously given size.
Top ↑
FTP couldnt retr file FTP couldnt retr file
CURL error code 19 – CURLE_FTP_COULDNT_RETR_FILE (19)
This was either a weird reply to a ‘RETR’ command or a zero byte transfer complete.
Top ↑
Quote error Quote error
CURL error code 21 – CURLE_QUOTE_ERROR (21)
When sending custom “QUOTE” commands to the remote server, one of the commands returned an error code that was 400 or higher (for FTP) or otherwise indicated unsuccessful completion of the command.
Top ↑
HTTP returned error HTTP returned error
CURL error code 22 – CURLE_HTTP_RETURNED_ERROR (22)
This is returned if CURLOPT_FAILONERROR is set TRUE and the HTTP server returns an error code that is >= 400.
Top ↑
Write error Write error
CURL error code 23 – CURLE_WRITE_ERROR (23)
An error occurred when writing received data to a local file, or an error was returned to libcurl from a write callback.
Top ↑
Upload failed Upload failed
CURL error code 25 – CURLE_UPLOAD_FAILED (25)
Failed starting the upload. For FTP, the server typically denied the STOR command. The error buffer usually contains the server’s explanation for this.
Top ↑
Read error Read error
CURL error code 26 – CURLE_READ_ERROR (26)
There was a problem reading a local file or an error returned by the read callback.
Top ↑
Out of memory Out of memory
CURL error code 27 – CURLE_OUT_OF_MEMORY (27)
A memory allocation request failed. This is serious badness and things are severely screwed up if this ever occurs.
Top ↑
Operation timedout Operation timedout
CURL error code 28 – CURLE_OPERATION_TIMEDOUT (28)
Operation timeout. The specified time-out period was reached according to the conditions.
Top ↑
FTP port failed FTP port failed
CURL error code 30 – CURLE_FTP_PORT_FAILED (30)
The FTP PORT command returned error. This mostly happens when you haven’t specified a good enough address for libcurl to use. See CURLOPT_FTPPORT.
Top ↑
FTP couldnt use rest FTP couldnt use rest
CURL error code 31 – CURLE_FTP_COULDNT_USE_REST (31)
The FTP REST command returned error. This should never happen if the server is sane.
Top ↑
Range error Range error
CURL error code 33 – CURLE_RANGE_ERROR (33)
The server does not support or accept range requests.
Top ↑
HTTP post error HTTP post error
CURL error code 34 – CURLE_HTTP_POST_ERROR (34)
This is an odd error that mainly occurs due to internal confusion.
Top ↑
SSL connect error SSL connect error
CURL error code 35 – CURLE_SSL_CONNECT_ERROR (35)
A problem occurred somewhere in the SSL/TLS handshake. You really want the error buffer and read the message there as it pinpoints the problem slightly more. Could be certificates (file formats, paths, permissions), passwords, and others.
Top ↑
Bad download resume Bad download resume
CURL error code 36 – CURLE_BAD_DOWNLOAD_RESUME (36)
The download could not be resumed because the specified offset was out of the file boundary.
Top ↑
File couldnt read file File couldnt read file
CURL error code 37 – CURLE_FILE_COULDNT_READ_FILE (37)
A file given with FILE:// couldn’t be opened. Most likely because the file path doesn’t identify an existing file. Did you check file permissions?
Top ↑
LDAP cannot bind LDAP cannot bind
CURL error code 38 – CURLE_LDAP_CANNOT_BIND (38)
LDAP cannot bind. LDAP bind operation failed.
Top ↑
LDAP search failed LDAP search failed
CURL error code 39 – CURLE_LDAP_SEARCH_FAILED (39)
LDAP search failed.
Top ↑
Function not found Function not found
CURL error code 41 – CURLE_FUNCTION_NOT_FOUND (41)
Function not found. A required zlib function was not found.
Top ↑
Aborted by callback Aborted by callback
CURL error code 42 – CURLE_ABORTED_BY_CALLBACK (42)
Aborted by callback. A callback returned “abort” to libcurl.
Top ↑
Bad function argument Bad function argument
CURL error code 43 – CURLE_BAD_FUNCTION_ARGUMENT (43)
A function was called with a bad parameter.
Top ↑
Interface failed Interface failed
CURL error code 45 – CURLE_INTERFACE_FAILED (45)
Interface error. A specified outgoing interface could not be used. Set which interface to use for outgoing connections’ source IP address with CURLOPT_INTERFACE.
Top ↑
Too many redirects Too many redirects
CURL error code 47 – CURLE_TOO_MANY_REDIRECTS (47)
Too many redirects. When following redirects, libcurl hit the maximum amount. Set your limit with CURLOPT_MAXREDIRS.
Top ↑
Unknown option Unknown option
CURL error code 48 – CURLE_UNKNOWN_OPTION (48)
An option passed to libcurl is not recognized/known. Refer to the appropriate documentation. This is most likely a problem in the program that uses libcurl. The error buffer might contain more specific information about which exact option it concerns.
Top ↑
Telnet option syntax Telnet option syntax
CURL error code 49 – CURLE_TELNET_OPTION_SYNTAX (49)
A telnet option string was Illegally formatted.
Top ↑
Got nothing Got nothing
CURL error code 52 – CURLE_GOT_NOTHING (52)
Nothing was returned from the server, and under the circumstances, getting nothing is considered an error.
Top ↑
SSL engine notfound SSL engine notfound
CURL error code 53 – CURLE_SSL_ENGINE_NOTFOUND (53)
The specified crypto engine wasn’t found.
Top ↑
SSL engine setfailed SSL engine setfailed
CURL error code 54 – CURLE_SSL_ENGINE_SETFAILED (54)
Failed setting the selected SSL crypto engine as default!
Top ↑
Send error Send error
CURL error code 55 – CURLE_SEND_ERROR (55)
Failed sending network data.
Top ↑
Recv error Recv error
CURL error code 56 – CURLE_RECV_ERROR (56)
Failure with receiving network data.
Top ↑
SSL certproblem SSL certproblem
CURL error code 58 – CURLE_SSL_CERTPROBLEM (58)
problem with the local client certificate.
Top ↑
SSL cipher SSL cipher
CURL error code 59 – CURLE_SSL_CIPHER (59)
Couldn’t use specified cipher.
Top ↑
PEER failed verification PEER failed verification
CURL error code 60 – CURLE_PEER_FAILED_VERIFICATION (60)
The remote server’s SSL certificate or SSH md5 fingerprint was deemed not OK. This error code has been unified with ## CURL error code – CURLE_SSL_CACERT since 7.62.0. Its previous value was 51.
Top ↑
Bad content encoding Bad content encoding
CURL error code 61 – CURLE_BAD_CONTENT_ENCODING (61)
Unrecognized transfer encoding.
Top ↑
LDAP invalid url LDAP invalid url
CURL error code 62 – CURLE_LDAP_INVALID_URL (62)
Invalid LDAP URL.
Top ↑
Filesize exceeded Filesize exceeded
CURL error code 63 – CURLE_FILESIZE_EXCEEDED (63)
Maximum file size exceeded.
Top ↑
Use ssl failed Use ssl failed
CURL error code 64 – CURLE_USE_SSL_FAILED (64)
Requested FTP SSL level failed.
Top ↑
Send fail rewind Send fail rewind
CURL error code 65 – CURLE_SEND_FAIL_REWIND (65)
When doing a send operation curl had to rewind the data to retransmit, but the rewinding operation failed.
Top ↑
SSL engine initfailed SSL engine initfailed
CURL error code 66 – CURLE_SSL_ENGINE_INITFAILED (66)
Initiating the SSL Engine failed.
Top ↑
Login denied Login denied
CURL error code 67 – CURLE_LOGIN_DENIED (67)
The remote server denied curl to login (Added in 7.13.1)
Top ↑
TFTP notfound TFTP notfound
CURL error code 68 – CURLE_TFTP_NOTFOUND (68)
File not found on TFTP server.
Top ↑
TFTP perm TFTP perm
CURL error code 69 – CURLE_TFTP_PERM (69)
Permission problem on TFTP server.
Top ↑
Remote disk full Remote disk full
CURL error code 70 – CURLE_REMOTE_DISK_FULL (70)
Out of disk space on the server.
Top ↑
TFTP illegal TFTP illegal
CURL error code 71 – CURLE_TFTP_ILLEGAL (71)
Illegal TFTP operation.
Top ↑
TFTP unknownid TFTP unknownid
CURL error code 72 – CURLE_TFTP_UNKNOWNID (72)
Unknown TFTP transfer ID.
Top ↑
Remote file exists Remote file exists
CURL error code 73 – CURLE_REMOTE_FILE_EXISTS (73)
File already exists and will not be overwritten.
Top ↑
TFTP nosuchuser TFTP nosuchuser
CURL error code 74 – CURLE_TFTP_NOSUCHUSER (74)
This error should never be returned by a properly functioning TFTP server.
Top ↑
Conv failed Conv failed
CURL error code 75 – CURLE_CONV_FAILED (75)
Character conversion failed.
Top ↑
Conv reqd Conv reqd
CURL error code 76 – CURLE_CONV_REQD (76)
Caller must register conversion callbacks.
Top ↑
SSL cacert badfile SSL cacert badfile
CURL error code 77 – CURLE_SSL_CACERT_BADFILE (77)
Problem with reading the SSL CA cert (path? access rights?)
Top ↑
Remote file not found Remote file not found
CURL error code 78 – CURLE_REMOTE_FILE_NOT_FOUND (78)
The resource referenced in the URL does not exist.
Top ↑
SSH SSH
CURL error code 79 – CURLE_SSH (79)
An unspecified error occurred during the SSH session.
Top ↑
SSL shutdown failed SSL shutdown failed
CURL error code 80 – CURLE_SSL_SHUTDOWN_FAILED (80)
Failed to shut down the SSL connection.
Top ↑
Again Again
CURL error code 81 – CURLE_AGAIN (81)
Socket is not ready for send/recv wait till it’s ready and try again. This return code is only returned from curl_easy_recv and curl_easy_send (Added in 7.18.2)
Top ↑
SSL crl badfile SSL crl badfile
CURL error code 82 – CURLE_SSL_CRL_BADFILE (82)
Failed to load CRL file (Added in 7.19.0)
Top ↑
SSL issuer error SSL issuer error
CURL error code 83 – CURLE_SSL_ISSUER_ERROR (83)
Issuer check failed (Added in 7.19.0)
Top ↑
FTP pret failed FTP pret failed
CURL error code 84 – CURLE_FTP_PRET_FAILED (84)
The FTP server does not understand the PRET command at all or does not support the given argument. Be careful when using CURLOPT_CUSTOMREQUEST, a custom LIST command will be sent with PRET CMD before PASV as well. (Added in 7.20.0)
Top ↑
RTSP cseq error RTSP cseq error
CURL error code 85 – CURLE_RTSP_CSEQ_ERROR (85)
Mismatch of RTSP CSeq numbers.
Top ↑
RTSP session error RTSP session error
CURL error code 86 – CURLE_RTSP_SESSION_ERROR (86)
Mismatch of RTSP Session Identifiers.
Top ↑
FTP bad file list FTP bad file list
CURL error code 87 – CURLE_FTP_BAD_FILE_LIST (87)
Unable to parse FTP file list (during FTP wildcard downloading).
Top ↑
Chunk failed Chunk failed
CURL error code 88 – CURLE_CHUNK_FAILED (88)
Chunk callback reported error.
Top ↑
No connection available No connection available
CURL error code 89 – CURLE_NO_CONNECTION_AVAILABLE (89)
(For internal use only, will never be returned by libcurl) No connection available, the session will be queued. (added in 7.30.0)
Top ↑
SSL pinnedpubkeynotmatch SSL pinnedpubkeynotmatch
CURL error code 90 – CURLE_SSL_PINNEDPUBKEYNOTMATCH (90)
Failed to match the pinned key specified with CURLOPT_PINNEDPUBLICKEY.
Top ↑
SSL invalidcertstatus SSL invalidcertstatus
CURL error code 91 – CURLE_SSL_INVALIDCERTSTATUS (91)
Status returned failure when asked with CURLOPT_SSL_VERIFYSTATUS.
Top ↑
HTTP2 stream HTTP2 stream
CURL error code 92 – CURLE_HTTP2_STREAM (92)
Stream error in the HTTP/2 framing layer.
Top ↑
Recursive api call Recursive api call
CURL error code 93 – CURLE_RECURSIVE_API_CALL (93)
An API function was called from inside a callback.
Top ↑
Auth error Auth error
CURL error code 94 – CURLE_AUTH_ERROR (94)
An authentication function returned an error.
Top ↑
HTTP3 HTTP3
CURL error code 95 – CURLE_HTTP3 (95)
A problem was detected in the HTTP/3 layer. This is somewhat generic and can be one out of several problems, see the error buffer for details.
Top ↑
Quic connect error Quic connect error
CURL error code 96 – CURLE_QUIC_CONNECT_ERROR (96)
QUIC connection error. This error may be caused by an SSL library error. QUIC is the protocol used for HTTP/3 transfers.
Top ↑
Obsolete* Obsolete*
CURL error code * – CURLE_OBSOLETE*
These error codes will never be returned. They were used in an old libcurl version and are currently unused.