0

I have this issue:

PHP Fatal error:  Call to undefined function curl_init() in /var/www/html/...on line 1495

I have enabled curl in my php.ini:

extension=php_curl.dll

but in my apache error log I see this:

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/20131226/php_curl.dll' - /usr/lib/php/20131226/php_curl.dll: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/20131226/php_gd2.dll' - /usr/lib/php/20131226/php_gd2.dll: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/20131226/php_mbstring.dll' - /usr/lib/php/20131226/php_mbstring.dll: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/20131226/php_mysql.dll' - /usr/lib/php/20131226/php_mysql.dll: cannot open shared object file: No such file or directory in Unknown on line 0

I have tried to install the curl extension with no luck.

Any idea how to fix it? I have no clue.

NAME="Debian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster

1 Answer 1

1

First, .dll is a Microsoft Windows file extension. On Linux world, the suffix for dynamic libraries is .so Looks like you copy/paste a bit fast....

Under Linux, you should user extension=curl (current setup on my Debian) or extension=php_curl (depending on your system..).

Moreover, you have to make sure that the PHP CURL binding is installed on your system.

$ dpkg -l|grep -i curl
ii  libcurl3-gnutls:amd64           7.64.0-4                      amd64        easy-to-use client-side URL transfer library (GnuTLS flavour)
ii  libcurl4:amd64                  7.64.0-4                      amd64        easy-to-use client-side URL transfer library (OpenSSL flavour)
ii  php-curl                        2:7.3+69                      all          CURL module for PHP [default]
ii  php7.3-curl                     7.3.9-1~deb10u1               amd64        CURL module for PHP

If the output of the command above doesn't report php-curl, then you have to apt-get install php-curl.

2
  • The simple apt install php-curl should probably add it to php.ini for you, so there's no need to do any manual editing. It does on Ubuntu, anyway, and I imagine it does on Debian.
    – TRiG
    Oct 21, 2019 at 9:59
  • You're right.... but it looks like OP crapped his php.ini by following an unappropriated tutorial on internet ...
    – binarym
    Oct 21, 2019 at 13:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .