Closed fwermelinger closed 7 years ago
Are you running the latest version of the library? (>=2.2.12 )? There has been a fix for a potential infinite loop a year ago.
Which math engine (bcmath or gmp) do you use your Ubuntu server? Can you switch engines to see if this resolves the infinite loop?
That was the problem. I was running version 2.2, probably because I copied the composer instructions from the readme.md php composer.phar require bitpay/php-client:^2.2
I had to change that to bitpay/php-client: 2.2.13
and then install bcmath on the ubuntu server. After that it worked. Might be a good idea to update the readme.md right?
Updated readme.md to use ~ instead of ^, so all composer users get the latest version of the php lib.
I am integrating bitpay for a website as a payment provider. The site is built using CodeIgniter. Everything worked fine on my local environment (windows, apache, php7). But when I run the same code on our test or production environment (ubuntu, apache, php7) the library causes the cpu to go to 100% and it does not finish (at least not in useful time. I let it run for up to 1 minute before cancelling the job or apache did it) The VPS I'm running it on has 2 gigs of ram and 2 cores. When I apache stopped the request, the php execution was at Bitpay\Math\RichArbitraryPrecisionIntegerMath\rpmul() : line 174
The code I run is a modification of your 001_ tutorial that creates private and public keys. Here is the source code. When I run this and check
top
in another terminal, the php process is at 100%. Could you help me solve this problem?And the output before it stalls: