Closed soravgarg123 closed 7 years ago
@soravgarg123 what is your error? I just have this error when I tried to create private key:
PHP Notice: Uninitialized string offset: 0 in [...]/Vendor/bitpay/php-client/src/Bitpay/Math/RichArbitraryPrecisionIntegerMath.php on line 230
And the page go into a infinite time of loading when I tried to create public key.
Then, I have installed 'php-bcmath' and it's ok now, the two keys are generated.
Hey, thanks @estebandelaf, this fixed my problem as well. For others curious, I was getting the NOTICE
when trying to generate the public and private keys:
PHP Notice: Uninitialized string offset: 0 in /etc/Bitpay/vendor/bitpay/php-client/src/Bitpay/Math/RichArbitraryPrecisionIntegerMath.php on line 230
To follow @estebandelaf 's advice for Ubuntu 17.04:
sudo apt-get install php-bcmath
sudo /etc/init.d/apache2 restart
I then reloaded the 001_generateKeys.php file, and all is well in the world again.
@kneeki finally, bcmath doesn't solve my problem. Yes, it works for creating public key. But, later, can't make the connection with Bitpay. I can't remember the exact error, but the problem was bcmath when I tried to create the invoice. I used gmp and removed bcmath.
Is another issue with the problem with bcmath: https://github.com/bitpay/php-bitpay-client/issues/237#issuecomment-326899419
Here i am running generatekey file but not generating private key and public key, please check it.
http://localhost/php-bitpay-client/examples/tutorial/001_generateKeys.php