How do I install the ext-curl extension with PHP 7?

后端 未结 12 730
终归单人心
终归单人心 2020-11-29 17:37

I\'ve installed PHP 7 using this repo, but when I try to run composer install, it\'s giving this error:

  • [package] requires ext-cu
相关标签:
12条回答
  • 2020-11-29 18:00

    If You have 404 or errors while sudo apt-get install php-curl just try

    sudo apt-get update
    

    and again try

    sudo apt-get install php-curl
    

    But notice what version was installed (i use php7.3 and php7.4-curl was installed - so it will not work)

    try then

    sudo apt-get install php7.3-curl
    

    At the end You may want to restart services like: apache2 or php-fpm:

    sudo apache2 restart
    sudo service php7.3-fpm restart
    

    this worked for me.

    Check if curl is on the installed modules list for current php:

    php -m
    

    0 讨论(0)
  • 2020-11-29 18:01

    I got an error that the CURL extension was missing whilst installing WebMail Lite 8 on WAMP (so on Windows).

    After reading that libeay32.dll was required which was only present in some of the PHP installation folders (such as 7.1.26), I switched the PHP version in use from 7.2.14 to 7.1.26 in the WAMP PHP version menu, and the error went away.

    0 讨论(0)
  • 2020-11-29 18:05

    If "sudo apt-get install php-curl" command doesnt work and display error We should run this code before install curl.

    • step1 - sudo add-apt-repository ppa:ondrej/php
    • step2 - sudo apt-get update
    • step3 - sudo apt-get install php-curl
    • step4 - sudo service apache2 restart
    0 讨论(0)
  • 2020-11-29 18:08

    Try it if you get E: Unable to locate package {packageName}

    sudo add-apt-repository main
    sudo add-apt-repository universe
    sudo add-apt-repository restricted
    sudo add-apt-repository multiverse
    sudo add-apt-repository ppa:ondrej/php
    sudo apt-get update
    sudo apt-get install php-curl
    
    0 讨论(0)
  • 2020-11-29 18:12

    install php70w-common.

    It provides php-api, php-bz2, php-calendar, php-ctype, php-curl, php-date, php-exif, php-fileinfo, php-filter, php-ftp, php-gettext, php-gmp, php-hash, php-iconv, php-json, php-libxml, php-openssl, php-pcre, php-pecl-Fileinfo, php-pecl-phar, php-pecl-zip, php-reflection, php-session, php-shmop, php-simplexml, php-sockets, php-spl, php-tokenizer, php-zend-abi, php-zip, php-zlib.

    https://webtatic.com/packages/php70/

    0 讨论(0)
  • 2020-11-29 18:14

    Well I was able to install it by :

    sudo apt-get install php-curl
    

    on my system. This will install a dependency package, which depends on the default php version.

    After that restart apache

    sudo service apache2 restart
    
    0 讨论(0)
提交回复
热议问题