How do I quickly install php-curl
on CentOS 8? It doesn’t seem to be available in the base software repository, or even Not available at EPEL either.
Update:
[root@example ~]# dnf repolist
repo id repo name
AppStream CentOS-8 - AppStream
BaseOS CentOS-8 - Base
epel Extra Packages for Enterprise Linux 8 - x86_64
epel-modular Extra Packages for Enterprise Linux Modular 8 - x86_64
extras CentOS-8 - Extras
[root@example ~]# dnf search php-curl
Last metadata expiration check: 0:08:15 ago on Sat 18 Jul 2020 08:48:47 AM UTC.
No matches found.
[root@example ~]# dnf search php-*
Last metadata expiration check: 0:08:26 ago on Sat 18 Jul 2020 08:48:47 AM UTC.
================================================== Name Matched: php-* ==================================================
php-gd.x86_64 : A module for PHP applications for using the gd graphics library
php-cli.x86_64 : Command-line interface for PHP
php-fpm.x86_64 : PHP FastCGI Process Manager
php-pdo.x86_64 : A database access abstraction module for PHP applications
php-xml.x86_64 : A module for PHP applications which use XML
php-dba.x86_64 : A database abstraction layer module for PHP applications
php-dbg.x86_64 : The interactive PHP debugger
php-gmp.x86_64 : A module for PHP applications for using the GNU MP library
php-json.x86_64 : JavaScript Object Notation extension for PHP
php-intl.x86_64 : Internationalization extension for PHP applications
php-ldap.x86_64 : A module for PHP applications that use LDAP
php-odbc.x86_64 : A module for PHP applications that use ODBC databases
php-pear.noarch : PHP Extension and Application Repository framework
php-snmp.x86_64 : A module for PHP applications that query SNMP-managed devices
php-soap.x86_64 : A module for PHP applications that use the SOAP protocol
php-devel.x86_64 : Files needed for building PHP extensions
php-pgsql.x86_64 : A PostgreSQL database module for PHP
php-common.x86_64 : Common files for PHP
php-bcmath.x86_64 : A module for PHP applications for using the bcmath library
php-recode.x86_64 : A module for PHP applications for using the recode library
php-xmlrpc.x86_64 : A module for PHP applications which use the XML-RPC protocol
php-mysqlnd.x86_64 : A module for PHP applications that use MySQL databases
php-opcache.x86_64 : The Zend OPcache
php-enchant.x86_64 : Enchant spelling extension for PHP applications
php-process.x86_64 : Modules for PHP script using system process interfaces
php-mbstring.x86_64 : A module for PHP applications which need multi-byte string handling
php-pecl-zip.x86_64 : A ZIP archive management extension
php-embedded.x86_64 : PHP library for embedding in applications
php-pecl-apcu.x86_64 : APC User Cache
php-pear-Date.noarch : Date and Time Zone Classes
php-pear-Mail.noarch : Class that provides multiple interfaces for sending emails
php-pear-Net-URL.noarch : Easy parsing of URLs
php-pear-Net-SMTP.noarch : Provides an implementation of the SMTP protocol
php-pear-Auth-SASL.noarch : Abstraction of various SASL mechanism responses
php-pecl-apcu-devel.x86_64 : APCu developer files (header)
php-pear-Cache-Lite.noarch : Fast and Safe little cache system for PHP
php-pear-Net-Socket.noarch : Network Socket Interface
php-pear-HTTP-Request.noarch : Provides an easy way to perform HTTP requests
[root@example ~]# dnf search curl
Last metadata expiration check: 0:10:34 ago on Sat 18 Jul 2020 08:48:47 AM UTC.
============================================== Name Exactly Matched: curl ===============================================
curl.x86_64 : A utility for getting files from remote servers (FTP, HTTP, and others)
============================================= Name & Summary Matched: curl ==============================================
collectd-curl.x86_64 : Curl plugin for collectd
qemu-kvm-block-curl.x86_64 : QEMU CURL block driver
collectd-curl_xml.x86_64 : Curl XML plugin for collectd
collectd-curl_json.x86_64 : Curl JSON plugin for collectd
perl-WWW-Curl.x86_64 : Perl extension interface for libcurl
python3-pycurl.x86_64 : Python interface to libcurl for Python 3
libcurl-devel.i686 : Files needed for building applications with libcurl
libcurl-devel.x86_64 : Files needed for building applications with libcurl
libcurl-minimal.i686 : Conservatively configured build of libcurl for minimal installations
libcurl-minimal.x86_64 : Conservatively configured build of libcurl for minimal installations
================================================== Name Matched: curl ===================================================
libcurl.x86_64 : A library for getting files from web servers
libcurl.i686 : A library for getting files from web servers
================================================= Summary Matched: curl =================================================
rubygem-curb.x86_64 : Ruby libcurl bindings
3
Answers
Installing PHP extensions are simple with the following syntax.
Now you can install some commonly used
php-extensions
for CentOs with the following command.for me work just install curl
and restart apache
Quite late, but for anyone else with the same issue, I found it was due to upgrading PHP (from 5.6 to 7.2 in my case); not all the dependencies were properly updated.
Try diagnosing by opening PHP in the shell (just type
php
). If you see a warning like so (note theundefined symbol: curl_pushheader_bynum
toward the end):You probably have an outdated version of the curl library. Don’t know why the
php-common
package isn’t set with a version dependency for this so it gets upgraded, but I fixed it withdnf update libcurl
. Restarted php/nginx and it was off and running!(note: if you aren’t using
dnf
, you should just be able to useyum
instead i.e.yum update libcurl
)