Bobcares

cURL error 3 url malformed : How we fix it

by | Mar 31, 2020

Stuck with cURL error 3 URL malformed message on your website? We can help you.

The error usually occurs due to incorrect URL usage or version mismatch between cURL and the underlying application.

At Bobcares, we often get requests to fix cURL errors, as a part of our Server Management Services.

Today, let’s see how our Support Engineers fixed the cURL error 3: <url> malformed for our customers.

What is cURL error 3 URL malformed?

As we know, cURL is a tool used to transfer data between servers using network protocols. However improper usage of cURL in applications often throws errors.

Users often approach us with cURL error 3 URL malformed. As the name specifies, the error shows up when the URL is improperly formatted. This can be either due to incorrect syntax or else due to a version mismatch between cURL and the application involved.

For instance, the error appears as

cURL error 3 url malformed.

Common Causes of “URL Malformed” Error

  • The URL must start with a valid protocol such as http://, https://, ftp://, etc. Not following the protocol or using an unsupported protocol can cause this error.
  • URLs should not contain spaces or other invalid characters. Special characters should be properly URL-encoded.
  • The URL may be missing essential parts, like the domain name or path.
  • Furthermore, simple typos in the URL can cause the error.

Next, we’ll go through a few cases where our Support Engineers fixed this error.

How do we fix the cURL error?

This cURL error occurs in different servers due to different reasons. So when customers approach, our Support Engineers will have a closer look at each case and fix it. Let’s see a few such cases here.

1. Error while using a Guzzle library

One of our customers was working with the guzzle library to make HTTP requests to an API. But it ended up in cURL error 3. So, we checked the code he used to make the HTTP request.

We saw a code to verify the HTTPS URL.

$client->get('/', ['verify' => true]);

Hence, we checked the API and client settings. And ensured that the secure URL works fine. This verification is an important security check. So we never recommend skipping this, instead, we specified the location of CA files in the server in the client settings.

We also found a mismatch between URL and URI. An identifier was specified for the parameter base_url instead of a locator. Hence it ended up in cURL error.

Hence, correcting the client setting fixed the error.

In general, when such problems arise we make sure that the URL is properly specified so that we can avoid errors.

2. Paystack Laravel package

Another customer had a package that integrated the Paystack payment gateway with the Laravel app. He was getting cURL error 3 URL malformed in the Laravel app.

Our Support Engineers checked the installation location of the package. In a Laravel project, we must install the dependencies or other packages inside the root project folder.

So we installed the package in the Laravel project folder and manually published the configuration file. Later, we checked whether the config folder had the paystack.php file in it. Only then the Laravel app can use the payment gateway without error.

After that, we cleared both the config cache and app cache in Laravel.

php artisan config:cache
php artisan cache:clear

Hence it fixed the error.

3. Outdated WordPress

In this case, the customer had a WordPress site with a Wordfence plugin. But while running a malware scan, it ended with the error cURL error 3: <url> malformed.

When we checked, we found that the user had an outdated WordPress. The cURL process was not able to read the WordPress URL. The URL used ‘//’ which a new cURL version doesn’t support.

Hence we upgraded the WordPress and fixed the error.

Additional tips

  • Carefully examine the URL we are using. Make sure it includes all the necessary components like protocol, domain name, and path, and that they are spelled correctly.
  • If the URL contains special characters or spaces, make sure they are properly URL encoded. We can use online tools or libraries in your programming language to handle URL encoding.
  • Pay attention to the syntax of the URL. Forward slashes (/) are used as separators, and there shouldn’t be any typos or extra characters.

[Still, having trouble with cURL error 3 URL malformed? – We’ll fix it for you.]

Conclusion

In short, cURL error 3 URL malformed occurs due to incorrect usage of URL or due to version mismatch between cURL and the underlying web application. Today, we also saw how our Support Engineers fixed 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";

2 Comments

    • Syam S

      Ok, please contact our support team via live chat

      Reply

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

_reb2bgeo - The visitor's geographical location

_reb2bloaded - Whether or not the script loaded for the visitor

_reb2bref - The referring URL for the visit

_reb2bsessionID - The visitor's RB2B session ID

_reb2buid - The visitor's RB2B user ID

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid
_reb2bgeo, _reb2bloaded, _reb2bref, _reb2bsessionID, _reb2buid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF