Installation composer php-amqplib

Foreword

When originally wanted RabbitMQ running on the ECS, and then run the client, then install php-amqplib on the windows in the windows of local, has been suggested:
at The "HTTPS: //mirrors.aliyun,com/composer/packages.json" File not BE the Downloaded could: php_network_getaddresses: GET
addrinfo failed the: do not know the host.
So, after had installed on the ECS by composer, then pulled on a local windows, but the problem again, install php-amqplib need bcmath this expansion, windows of php comes, then install linux on the need to compile their own, so With this blog record it.

process

bcmath.zip file link bcmath.zip

  • After downloading scpto ECSthe decompression and
  • cdJust to finish extracting the file, run the phpizecommand, phpize command in the bin directory PHP installation directory, for example /usr/local/php-5.6.36/bin/phpize
cd 	bcmath
phpize
  • Run the phpizecommand, bcmaththe folder will be more files, then execute the following command
./configure #只有一个php版本时运行这个命令
./configure --with-php-config=/usr/local/php-5.6.36(填要用的php版本)/bin/php-config #拥有多个版本的php运行这个命令
  • Execute make && make installthe command
  • After execution will be bcmath.so, in a position either bcmathin, or in bcmath/modules, the question will need to copy it to the directory configuration in the php.ini extension_dir
  • Run php -i | grep extension_dir, you can get a directory of exetension_dir
extension_dir => /usr/lib64/php/modules => /usr/lib64/php/modules
sqlite3.extension_dir => no value => no value
  • Will be just a bcmath.sofile copy past
mv bcmath.so /usr/lib64/php/modules
  • Modify php.inithe configuration file, you can look for your own configuration file in ini which, in general /etcin
vim /etc/php.ini

#在最后一行添加
extension=bcmath.so
  • Restart phpService
systemctl restart php-fpm
  • echo phpinfoView
    Here Insert Picture Description

At last

By composer require php-amqplib/php-amqplibnormal download, after downloading scpto a local windows project

Published 48 original articles · won praise 56 · views 20000 +

Guess you like

Origin blog.csdn.net/zhetmdoubeizhanyong/article/details/103008553