gpt4 book ai didi

php - NGINX - 安装了 CURL 扩展,但系统说它丢失了

转载 作者:行者123 更新时间:2023-12-04 19:01:49 25 4
gpt4 key购买 nike

我正在尝试使用 composer 更新 Laravel 项目,但系统显示:

Problem 1

- Installation request for netshell/paypal dev-master -> satisfiable by netshell/paypal[dev-master].
- netshell/paypal dev-master requires ext-curl * -> the requested PHP extension curl is missing from your system.

To enable extensions, verify that they are enabled in your .ini files:
- /etc/php/5.6/cli/php.ini
- /etc/php/5.6/cli/conf.d/10-mysqlnd.ini
- /etc/php/5.6/cli/conf.d/10-opcache.ini
- /etc/php/5.6/cli/conf.d/10-pdo.ini
- /etc/php/5.6/cli/conf.d/15-xml.ini
- /etc/php/5.6/cli/conf.d/20-calendar.ini
- /etc/php/5.6/cli/conf.d/20-ctype.ini
- /etc/php/5.6/cli/conf.d/20-dom.ini
- /etc/php/5.6/cli/conf.d/20-exif.ini
- /etc/php/5.6/cli/conf.d/20-fileinfo.ini
- /etc/php/5.6/cli/conf.d/20-ftp.ini
- /etc/php/5.6/cli/conf.d/20-gettext.ini
- /etc/php/5.6/cli/conf.d/20-iconv.ini
- /etc/php/5.6/cli/conf.d/20-json.ini
- /etc/php/5.6/cli/conf.d/20-mbstring.ini
- /etc/php/5.6/cli/conf.d/20-mcrypt.ini
- /etc/php/5.6/cli/conf.d/20-mysql.ini
- /etc/php/5.6/cli/conf.d/20-mysqli.ini
- /etc/php/5.6/cli/conf.d/20-pdo_mysql.ini
- /etc/php/5.6/cli/conf.d/20-phar.ini
- /etc/php/5.6/cli/conf.d/20-posix.ini
- /etc/php/5.6/cli/conf.d/20-readline.ini
- /etc/php/5.6/cli/conf.d/20-shmop.ini
- /etc/php/5.6/cli/conf.d/20-simplexml.ini
- /etc/php/5.6/cli/conf.d/20-sockets.ini
- /etc/php/5.6/cli/conf.d/20-sysvmsg.ini
- /etc/php/5.6/cli/conf.d/20-sysvsem.ini
- /etc/php/5.6/cli/conf.d/20-sysvshm.ini
- /etc/php/5.6/cli/conf.d/20-tokenizer.ini
- /etc/php/5.6/cli/conf.d/20-wddx.ini
- /etc/php/5.6/cli/conf.d/20-xmlreader.ini
- /etc/php/5.6/cli/conf.d/20-xmlwriter.ini
- /etc/php/5.6/cli/conf.d/20-xsl.ini
You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.

机器是:
Ubuntu 14.04
Nginx
PHP 5.6

我已经做了很多步骤,例如:
  • apt-get 安装 curl
  • apt-get 安装 php-curl
  • 服务 php5-fpm 重启
  • 服务 nginx 重启

  • 而且还是不行……

    我也有 curl.ini 文件:
    ; configuration for php CURL module
    ; priority=20
    extension=curl.so

    我的 phpinfo 说 curl 已启用:

    enter image description here

    我还能做什么?

    最佳答案

    composer和 nginx 使用不同的 PHP 解释器。你有 php-curl 启用php-fpm , 但不适用于 php-cli .

    您可以确定 使用的实际配置文件。 php-cli 通过运行 php --ini (你可能会看到 curl.ini 不在其中)

    通过以下方式启用它:

    sudo ln -s /etc/php/5.6/mods-available/curl.ini /etc/php/5.6/cli/conf.d/20-curl.ini

    关注 : 第一个参数应该是 curl.ini 文件的实际位置。所以也可以
    sudo ln -s /etc/php5/mods-available/curl.ini /etc/php/5.6/cli/conf.d/20-curl.ini

    如果你跑了 php --info | grep curl -C 3你会看到 curl 是否真的为你的 php-cli 安装启用了。

    关于php - NGINX - 安装了 CURL 扩展,但系统说它丢失了,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41344831/

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