"Sistem anda tiada sambungan PHP yang diperlukan bcmath."
P粉029057928
P粉029057928 2023-10-16 15:06:32
0
1
552

Say hello kepada pembangun,

Saya cuba menggunakan Komposer untuk projek PHP saya pada pelayan pembangunan yang dilancarkan baru-baru ini, tetapi atas sebab tertentu saya tidak dapat berbuat demikian. Saya berjaya memasang Komposer, bagaimanapun, apabila saya cuba menjalankan perintah require, saya mendapat ralat berikut:

root@webserver:/var/mypersonal/index# composer require php-amqplib/php-amqplib
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/php_openssl.dll' - /usr/lib/php/20151012/php_openssl.dll: cannot open shared object file: No such file or directory in Unknown on line 0
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Using version ^2.6 for php-amqplib/php-amqplib
./composer.json has been created
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - php-amqplib/php-amqplib v2.6.3 requires ext-bcmath * -> the requested PHP extension bcmath is missing from your system.
    - php-amqplib/php-amqplib v2.6.2 requires ext-bcmath * -> the requested PHP extension bcmath is missing from your system.
    - php-amqplib/php-amqplib v2.6.1 requires ext-bcmath * -> the requested PHP extension bcmath is missing from your system.
    - php-amqplib/php-amqplib v2.6.0 requires ext-bcmath * -> the requested PHP extension bcmath is missing from your system.
    - Installation request for php-amqplib/php-amqplib ^2.6 -> satisfiable by php-amqplib/php-amqplib[v2.6.0, v2.6.1, v2.6.2, v2.6.3].

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

Installation failed, deleting ./composer.json.

Saya mengandaikan ini ada kaitan dengan amaran PHP yang saya terima semasa menjalankan arahan composer require, tetapi tiada hasil carian Google membawa saya ke arah yang betul.

Selain itu, saya telah menyediakan fail /etc/php/7.0/cli/php.ini saya sekiranya terdapat ralat dalam fail tersebut.

https://gist.github.com/anonymous/bc5bac59d684cbf575cef931ef36daf6 (Disebabkan had aksara siaran, saya tidak boleh memasukkan fail dalam siaran ini.)

P粉029057928
P粉029057928

membalas semua(1)
P粉428986744

Anda boleh menggunakan fungsi get_loaded_extensions untuk melihat jika bcmath 模块已加载。或者在终端 php -mphp -m | grep name_of_the_modul

Anda boleh memasangnya mengikut sistem operasi yang anda gunakan:

Percuma

sudo apt install php7.0-bcmath

CentOS

yum 安装 bcmath

Muat turun terkini
Lagi>
kesan web
Kod sumber laman web
Bahan laman web
Templat hujung hadapan
Tentang kita Penafian Sitemap
Laman web PHP Cina:Latihan PHP dalam talian kebajikan awam,Bantu pelajar PHP berkembang dengan cepat!