When setting up Woocommerce store, you may see the error message: WooCommerce Gateway PayPal Checkout requires cURL to be installed on your server.
This error can be solved very quickly if you are familiar with Linux environment
Contents
What is cURL
cURL stands for Client URL is a command-line tool used to check the connection from the URL and allow data transfer. cURL uses many different support protocols such as HTTP, HTTPS, FTPS, … cURL was born in 1997, written by Daniel Stenberg.
For example, you can download a file from a website using CURL using the following command:
curl -o myfile.zip http://mydomain.com/myfile.zip
You can also download a file via FTP protocol using cURL
curl -u username:password -O ftp://your.ip.address/myfile.zip
cURL is also used in many functions in Woocommerce, including Paypal checkout, that’s why you see the error message if cURL is not installed on your server
Check if cURL is installed on your server
To check if cURL is already installed on your server, create a phpinfo.php file with the following code
<?php // Show all php information phpinfo(); ?>
Next, access the path to phpinfo.php and see the result
Note: sometime cURL is installed but not enabled in php.ini file => cURL support still shows as: disabled
How to install and enable cURL for Woocommerce
Now we will install cURL extension to your VPS/Server to fix the error
Install cURL on a VPS/Dedicated server
If you are running your Woocommerce website on a VPS/Dedicated server, we can easily install cURL with this command
sudo apt install curl
Sample output:
Verify if cURL is successfully installed
curl --version
Sample output
root@wooexplorer:/# curl --version curl 7.47.0 (x86_64-pc-linux-gnu) libcurl/7.47.0 GnuTLS/3.4.10 zlib/1.2.8 libidn/1.32 librtmp/2.3 Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp smb smbs smtp smtps telnet tftp Features: AsynchDNS IDN IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz TLS-SRP UnixSockets
Enable cURL
The cURL extension was just installed, now we will enable to make it work in PHP
Now connect to your server via SFTP protocol and look for php.ini file
- For ubuntu user, the path to
php.ini
is: /etc/php/7.0/apache2/php.ini - For centos user, the path to php.ini is: /etc/php.ini
You can also use command to find path to php.ini
php -i | grep "Loaded Configuration File" Loaded Configuration File => /etc/php.ini
Next, edit php.ini file and add or uncomment the following line to enable cURL
extension=php_curl.dll
Finally, restart apache to make it work
Ubuntu
service apache2 restart
Centos
service httpd restart
If you’re running on a shared hosting, just ask the the support and they staff will install and enable cURL for you right away.
Now visit your Woocommerce store and error was completely fixed