安装 php 扩展不起作用

安装 php 扩展不起作用

当我尝试执行 composer install 时,显示一条错误,提示需要一些扩展。然后我取消注释 php.ini 上的扩展,通过“sudo apt-get install curl”安装这些扩展,并重新启动 apache 服务器,但仍然不起作用,不知道还能做什么。

armando@armando-VIT-P2400:/var/www/html/zxccxz$ sudo composer install
[sudo] contraseña para armando: 
PHP Warning:  PHP Startup: Unable to load dynamic library 'curl' (tried:     /usr/lib/php/20170718/curl (/usr/lib/php/20170718/curl: cannot open shared      object file: No such file or directory), /usr/lib/php/20170718/curl.so  (/usr/lib/php/20170718/curl.so: cannot open shared object file: No such file   or directory)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'openssl'   (tried: /usr/lib/php/20170718/openssl (/usr/lib/php/20170718/openssl: cannot  open shared object file: No such file or directory), /usr/lib/php/20170718  /openssl.so (/usr/lib/php/20170718/openssl.so: cannot open shared object file:  No such file or directory)) in Unknown on line 0
PHP Warning:  Module 'fileinfo' already loaded in Unknown on line 0
PHP Warning:  Module 'intl' already loaded in Unknown on line 0
PHP Warning:  Module 'mbstring' already loaded in Unknown on line 0
Do not run Composer as root/super user! See https://getcomposer.org/root   for details
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.

Problem 1
- The requested PHP extension ext-pdo_sqlite * is missing from your  system. Install or enable PHP's pdo_sqlite extension.
Problem 2
- Installation request for league/uri-components 1.8.2 -> satisfiable by  league/uri-components[1.8.2].
- league/uri-components 1.8.2 requires ext-curl * -> the requested PHP  extension curl is missing from your system.
Problem 3
- Installation request for paypal/rest-api-sdk-php 1.14.0 -> satisfiable  by paypal/rest-api-sdk-php[1.14.0].
- paypal/rest-api-sdk-php 1.14.0 requires ext-curl * -> the requested PHP  extension curl is missing from your system.
Problem 4
- Installation request for stripe/stripe-php v4.13.0 -> satisfiable by stripe/stripe-php[v4.13.0].
- stripe/stripe-php v4.13.0 requires ext-curl * -> the requested PHP extension curl is missing from your system.
Problem 5
- Installation request for symfony/framework-bundle v4.2.1 -> satisfiable  by symfony/framework-bundle[v4.2.1].
- symfony/framework-bundle v4.2.1 requires ext-xml * -> the requested PHP extension xml is missing from your system.
Problem 6
- Installation request for symfony/security-bundle v4.2.1 -> satisfiable by symfony/security-bundle[v4.2.1].
- symfony/security-bundle v4.2.1 requires ext-xml * -> the requested PHP extension xml is missing from your system.

答案1

简单使用:

sudo apt-get install php-**extenation name here**

然后必须重新启动 Apache 服务,使用:

sudo service apache2 restart

相关内容