简体   繁体   English

在 AWS EC2 实例上的 wordpress 中找不到 cURL

[英]cURL not found in wordpress on AWS EC2 instance

On my Wordpress site the cURL command doesn't seem to work:在我的 Wordpress 站点上, cURL命令似乎不起作用:

在此处输入图像描述

When I login into Wordpress, it clearly says cURL is not installed:当我登录 Wordpress 时,它清楚地cURL未安装:

在此处输入图像描述

However, when I SSH into my EC2 instance, I shows that cURL is installed:但是,当我将 SSH 放入我的 EC2 实例时,我显示已安装 cURL:

$ curl --version
curl 7.58.0 (x86_64-pc-linux-gnu) libcurl/7.58.0 OpenSSL/1.1.1 zlib/1.2.11 libidn2/2.3.0 libpsl/0.19.1 (+libidn2/2.0.4) nghttp2/1.30.0 librtmp/2.3
Release-Date: 2018-01-24
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp smb smbs smtp smtps telnet tftp 
Features: AsynchDNS IDN IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz TLS-SRP HTTP2 UnixSockets HTTPS-proxy PSL

Because PHP is outdated, maybe it could be an PHP issue?因为 PHP 已过时,可能是 PHP 问题? When I check my PHP version, I shows I have the latest version installed:当我检查我的 PHP 版本时,我显示我安装了最新版本:

$ php -v
PHP 8.2.1 (cli) (built: Jan 13 2023 10:42:21) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.1, Copyright (c) Zend Technologies
    with Zend OPcache v8.2.1, Copyright (c), by Zend Technologies

But when I list all my PHP installs, I see that the top one corresponds with the one mentioned in Wordpress ( 7.3.33-9+ubuntu18.04.1+deb.sury.org+1 ):但是当我列出我所有的 PHP 安装时,我看到最上面的那个对应于 Wordpress ( 7.3.33-9+ubuntu18.04.1+deb.sury.org+1 ) 中提到的那个:

$ dpkg --list | grep php
ii  libapache2-mod-php7.3            7.3.33-9+ubuntu18.04.1+deb.sury.org+1       amd64        server-side, HTML-embedded scripting language (Apache 2 module)
ii  libapache2-mod-php8.2            8.2.1-2+ubuntu18.04.1+deb.sury.org+1        amd64        server-side, HTML-embedded scripting language (Apache 2 module)
ii  php                              2:8.2+93+ubuntu18.04.1+deb.sury.org+2       all          server-side, HTML-embedded scripting language (default)
ii  php-common                       2:93+ubuntu18.04.1+deb.sury.org+2           all          Common files for PHP packages
ii  php-curl                         2:8.2+93+ubuntu18.04.1+deb.sury.org+2       all          CURL module for PHP [default]
ii  php-fpm                          2:8.2+93+ubuntu18.04.1+deb.sury.org+2       all          server-side, HTML-embedded scripting language (FPM-CGI binary) (default)
ii  php-gd                           2:8.2+93+ubuntu18.04.1+deb.sury.org+2       all          GD module for PHP [default]
ii  php-mbstring                     2:8.2+93+ubuntu18.04.1+deb.sury.org+2       all          MBSTRING module for PHP [default]
rc  php7.0-curl                      7.0.33-0ubuntu0.16.04.2                     amd64        CURL module for PHP
ii  php7.2-cli                       7.2.34-37+ubuntu18.04.1+deb.sury.org+1      amd64        command-line interpreter for the PHP scripting language
ii  php7.2-common                    7.2.34-37+ubuntu18.04.1+deb.sury.org+1      amd64        documentation, examples and common module for PHP
ii  php7.2-curl                      7.2.34-37+ubuntu18.04.1+deb.sury.org+1      amd64        CURL module for PHP
ii  php7.2-fpm                       7.2.34-37+ubuntu18.04.1+deb.sury.org+1      amd64        server-side, HTML-embedded scripting language (FPM-CGI binary)
ii  php7.2-gd                        7.2.34-37+ubuntu18.04.1+deb.sury.org+1      amd64        GD module for PHP
ii  php7.2-json                      7.2.34-37+ubuntu18.04.1+deb.sury.org+1      amd64        JSON module for PHP
ii  php7.2-mbstring                  7.2.34-37+ubuntu18.04.1+deb.sury.org+1      amd64        MBSTRING module for PHP
ii  php7.2-mysql                     7.2.34-37+ubuntu18.04.1+deb.sury.org+1      amd64        MySQL module for PHP
ii  php7.2-opcache                   7.2.34-37+ubuntu18.04.1+deb.sury.org+1      amd64        Zend OpCache module for PHP
ii  php7.2-readline                  7.2.34-37+ubuntu18.04.1+deb.sury.org+1      amd64        readline module for PHP
ii  php7.3                           7.3.33-9+ubuntu18.04.1+deb.sury.org+1       all          server-side, HTML-embedded scripting language (metapackage)
ii  php7.3-cli                       7.3.33-9+ubuntu18.04.1+deb.sury.org+1       amd64        command-line interpreter for the PHP scripting language
ii  php7.3-common                    7.3.33-9+ubuntu18.04.1+deb.sury.org+1       amd64        documentation, examples and common module for PHP
ii  php7.3-json                      7.3.33-9+ubuntu18.04.1+deb.sury.org+1       amd64        JSON module for PHP
ii  php7.3-mysql                     7.3.33-9+ubuntu18.04.1+deb.sury.org+1       amd64        MySQL module for PHP
ii  php7.3-opcache                   7.3.33-9+ubuntu18.04.1+deb.sury.org+1       amd64        Zend OpCache module for PHP
ii  php7.3-readline                  7.3.33-9+ubuntu18.04.1+deb.sury.org+1       amd64        readline module for PHP
ii  php8.2                           8.2.1-2+ubuntu18.04.1+deb.sury.org+1        all          server-side, HTML-embedded scripting language (metapackage)
ii  php8.2-cli                       8.2.1-2+ubuntu18.04.1+deb.sury.org+1        amd64        command-line interpreter for the PHP scripting language
ii  php8.2-common                    8.2.1-2+ubuntu18.04.1+deb.sury.org+1        amd64        documentation, examples and common module for PHP
ii  php8.2-curl                      8.2.1-2+ubuntu18.04.1+deb.sury.org+1        amd64        CURL module for PHP
ii  php8.2-fpm                       8.2.1-2+ubuntu18.04.1+deb.sury.org+1        amd64        server-side, HTML-embedded scripting language (FPM-CGI binary)
ii  php8.2-gd                        8.2.1-2+ubuntu18.04.1+deb.sury.org+1        amd64        GD module for PHP
ii  php8.2-mbstring                  8.2.1-2+ubuntu18.04.1+deb.sury.org+1        amd64        MBSTRING module for PHP
ii  php8.2-opcache                   8.2.1-2+ubuntu18.04.1+deb.sury.org+1        amd64        Zend OpCache module for PHP
ii  php8.2-readline                  8.2.1-2+ubuntu18.04.1+deb.sury.org+1        amd64        readline module for PHP

I've also tried rebooting from the AWS EC2 dashboard.我也试过从 AWS EC2 仪表板重新启动。

lel, you have php7.0-curl and php7.2-curl and php8.2-curl, but you run WordPress on the 1 php where you don't have curl: php7.3 lel,你有 php7.0-curl 和 php7.2-curl 和 php8.2-curl,但是你在 1 php 上运行 WordPress 而你没有 curl:php7.3

sudo apt update;
sudo apt install php7.3-curl;
  • you should consider upgrading the php you run wordpress on though: PHP7.3 went EOL 6 desember 2021;您应该考虑升级运行 wordpress 的 php:PHP7.3 于 2021 年 12 月 6 日停产; by comparison, PHP8.2 is scheduled to go EOL 8 desember 2025.相比之下,PHP8.2 计划于 2025 年 12 月 8 日停产 go。
  • it's very rare that you need any PHP5 version other than 5.6, and any PHP7 version other than 7.4, i suggest you install php7.4 and uninstall 7.0, 7.2, and 7.3.您很少需要 5.6 以外的任何 PHP5 版本和 7.4 以外的任何 PHP7 版本,我建议您安装 php7.4 并卸载 7.0、7.2 和 7.3。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM