Reputation: 49
I get an error after I enable curl in /etc/php/8.1/cli/php.ini:
PHP Warning: PHP Startup: Unable to load dynamic library 'curl' (tried: /usr/lib/php/20210902/curl (/usr/lib/php/20210902/curl: cannot open shared object file: No such file or directory), /usr/lib/php/20210902/curl.so (/usr/lib/php/20210902/curl.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP 8.1.2-1ubuntu2.10 (cli) (built: Jan 16 2023 15:19:49) (NTS)
I did:
$ sudo apt update
$ sudo apt upgrade
$ sudo apt install curl
$ curl -V
curl 7.81.0 (x86_64-pc-linux-gnu) libcurl/7.81.0 OpenSSL/3.0.2 zlib/1.2.11 brotli/1.0.9 zstd/1.4.8 libidn2/2.3.2 libpsl/0.21.0 (+libidn2/2.3.2) libssh/0.9.6/openssl/zlib nghttp2/1.43.0 librtmp/2.3 OpenLDAP/2.5.13
Release-Date: 2022-01-05
Protocols: dict file ftp ftps gopher gophers http https imap imaps ldap ldaps mqtt pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: alt-svc AsynchDNS brotli GSS-API HSTS HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM NTLM_WB PSL SPNEGO SSL TLS-SRP UnixSockets zstd
Upvotes: 0
Views: 5197
Reputation: 21513
with apt
you're not supposed to enable curl in php.ini. instead you're supposed to let apt enable it automatically by installing the package php-curl
sudo apt install php-curl
will install and enable curl in your default php version. if you have more than 1 php version, and php8.1 is not your default version, then you'll also have to run
sudo apt install php8.1-curl
(but if 8.1 is your default php version, then i don't recommend installing 8.1-curl manually)
Upvotes: 1