PHP Fatal error: Uncaught Error: Call to undefined function curl_init()1 min read

We need your support!!
Other Amount:
techrunnr.com:
24-Hour Flash Sale. Courses from just ₹ 490.
Prabhin Prabharkaran Administrator
DevOps Engineer

He is a Technical professional. He is a person who loves to share tricks and tips on the Internet. He Posts what he does!

follow me

Hi all, this document deals with how to fix the error “PHP Fatal error: Uncaught Error: Call to undefined function curl_init()”.

This is an exception by PHP when it detects the required plugin is missing. Here the missing PHP library is curl.

Step 1: check your PHP version.

php -v

 

Expected output

php -v
PHP 7.2.18 (cli) (built: Apr 30 2019 15:26:52) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies

Step 2: Now you can see the PHP version is 7.2 using

Step 3: Now install the dependency packages such as gd and ImageMagick

Step 4: choose the package for your version.

For Ubuntu

apt-cache search php|grep curl

For Centos

 

yum search php|grep gd

Step 5:  Now choose the PHP curl package for your PHP version and install it.

Step 6:  Install the package.

For Ubuntu

apt-get install php-curl

For Centos

yum install php-curl

 

Step 7: Once the package is installed, restart your web server.

Nginx

service nginx restart

Apache

service apache2 restart

service httpd restart

We need your support!!
Other Amount:
techrunnr.com:
#1
#2
#3
Questions Answered
Articles Written
Overall Points

Prabhin Prabharkaran

He is Technical professional. He is a person who loves to share tricks and tips on the Internet. He Posts what he does!!

You may also like...

Leave a Reply