gpt4 book ai didi

php - 如何在 CentOS 8 中安装 php-curl?

转载 作者:行者123 更新时间:2023-12-05 08:11:10 29 4
gpt4 key购买 nike

如何在CentOS 8上快速安装php-curl?它似乎在基础软件存储库中不可用,甚至在 EPEL 中也不可用。

更新:

[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

最佳答案

很晚了,但对于遇到同样问题的其他人,我发现这是由于升级 PHP(在我的情况下从 5.6 到 7.2);并非所有依赖项都已正确更新。

尝试通过在 shell 中打开 PHP 进行诊断(只需键入 php)。如果您看到这样的警告(请注意结尾处的 undefined symbol: curl_pushheader_bynum):

PHP Warning:  PHP Startup: Unable to load dynamic library 'curl' (tried: /usr/lib64/php/modules/curl (/usr/lib64/php/modules/curl: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/curl.so (/usr/lib64/php/modules/curl.so: undefined symbol: curl_pushheader_bynum)) in Unknown on line 0

您的 curl 库版本可能已过时。不知道为什么 php-common 包没有为此设置版本依赖性,所以它会升级,但我用 dnf update libcurl 修复了它。重新启动 php/nginx,它已关闭并运行!

(注意:如果您不使用 dnf,您应该可以使用 yum,即 yum update libcurl)

关于php - 如何在 CentOS 8 中安装 php-curl?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62966093/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com