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

后端 未结 12 752
终归单人心
终归单人心 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
    

提交回复
热议问题