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
scp
toECS
the decompression and cd
Just to finish extracting the file, run thephpize
command, phpize command in the bin directory PHP installation directory, for example /usr/local/php-5.6.36/bin/phpize
cd bcmath
phpize
- Run the
phpize
command,bcmath
the 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 install
the command - After execution will be
bcmath.so
, in a position eitherbcmath
in, or inbcmath/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.so
file copy past
mv bcmath.so /usr/lib64/php/modules
- Modify
php.ini
the configuration file, you can look for your own configuration file in ini which, in general/etc
in
vim /etc/php.ini
#在最后一行添加
extension=bcmath.so
- Restart
php
Service
systemctl restart php-fpm
echo phpinfo
View
At last
By composer require php-amqplib/php-amqplib
normal download, after downloading scp
to a local windows project