PHP Fatal error: Call to undefined function curl_init() in /home/httpd/a/includes/functions.php(1)
How do I solve this problem on Linux server?
You need to install the CURL module for PHP 5 or 7. cURL is a library that lets you make HTTP requests in PHP. In order to use PHP’s cURL functions you need to install the libcurl package. To solve this problem install php-curl as per your Linux / Unix distro and restart the web-server or php-fpm service.
Install CURL module for PHP on Ubuntu / Debian Linux
Type the following apt-get command or apt command to install CURL module for PHP 5.x:
$ sudo apt-get install php-curl
Type the following apt-get command or apt command to install CURL module for PHP 7.x:
$ sudo apt-get install php7.0-curl
Install CURL module for PHP on RHEL/CentOS/Scientific Linux
Type the following yum command:
$ sudo yum install php-curl
OR
$ sudo yum install php-common
The above should install php-common to enable curl support.
Install CURL module for PHP on Alpine Linux
Type the following apk command:
# apk add php5-curl
OR
# apk add php7-curl
Install CURL module for PHP on FreeBSD Unix
To install the port for PHP 5.x:
# cd /usr/ports/ftp/php56-curl/ && make install clean
Or To add the package for PHP 5.x use the pkg command:
# pkg install php56-curl
To install the port for PHP 7.x:
# cd /usr/ports/ftp/php70-curl/ && make install clean
Or To add the package for PHP 7.x:
# pkg install php70-curl
Restart Apache/Nginx or PHP-FPM service
Type the following command to restart nginx:
$ sudo service nginx restart
OR
$ sudo /etc/init.d/nginx restart
OR
$ sudo systemctl restart nginx
OR
# rc-service nginx restart
If you are using php-fpm, enter:
# rc-service php-fpm restart
OR
# /etc/init.d/php7.0-fpm restart
OR
# /etc/init.d/php5.0-fpm restart
OR
$ sudo systemctl restart php7.0-fpm.service
🐧 Get the latest tutorials on Linux, Open Source & DevOps via:
- RSS feed or Weekly email newsletter
- Share on Twitter • Facebook • 0 comments... add one ↓
Category | List of Unix and Linux commands |
---|---|
File Management | cat |
Firewall | Alpine Awall • CentOS 8 • OpenSUSE • RHEL 8 • Ubuntu 16.04 • Ubuntu 18.04 • Ubuntu 20.04 |
Network Utilities | dig • host • ip • nmap |
OpenVPN | CentOS 7 • CentOS 8 • Debian 10 • Debian 8/9 • Ubuntu 18.04 • Ubuntu 20.04 |
Package Manager | apk • apt |
Processes Management | bg • chroot • cron • disown • fg • jobs • killall • kill • pidof • pstree • pwdx • time |
Searching | grep • whereis • which |
User Information | groups • id • lastcomm • last • lid/libuser-lid • logname • members • users • whoami • who • w |
WireGuard VPN | Alpine • CentOS 8 • Debian 10 • Firewall • Ubuntu 20.04 |