vinkla / hashids

A small PHP library to generate YouTube-like ids from numbers. Use it when you don't want to expose your database ids to the user.
https://hashids.org/php
MIT License
5.28k stars 418 forks source link

HashIds not working with macOS Sonoma 14.2 #199

Closed prattcmp closed 7 months ago

prattcmp commented 7 months ago

When I updated to macOS Sonoma 14.2, hashids stopped working. Other packages are able to access bcmath, but for some reason hashids has stopped working. It is a dependency. for short URLs.

Missing math extension for Hashids, install either bcmath or gmp. {"exception":"[object] (RuntimeException(code: 0): Missing math extension for Hashids, install either bcmath or gmp. at /var/www/html/vendor/hashids/hashids/src/Hashids.php:297) [stacktrace] #0 /var/www/html/vendor/hashids/hashids/src/Hashids.php(42): Hashids\\Hashids->getMathExtension() #1 /var/www/html/vendor/ashallendesign/short-url/src/Classes/KeyGenerator.php(23): Hashids\\Hashids->__construct() 2 /var/www/html/vendor/ashallendesign/short-url/src/Classes/Builder.php(192): AshAllenDesign\\ShortURL\\Classes\\KeyGenerator->__construct() 3 /var/www/html/vendor/ashallendesign/short-url/src/Providers/ShortURLProvider.php(22): AshAllenDesign\\ShortURL\\Classes\\Builder->__construct() 4 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(908): AshAllenDesign\\ShortURL\\Providers\\ShortURLProvider->AshAllenDesign\\ShortURL\\Providers\\{closure}() 5 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(795): Illuminate\\Container\\Container->build() 6 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(955): Illuminate\\Container\\Container->resolve() 7 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(731): Illuminate\\Foundation\\Application->resolve() 8 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(940): Illuminate\\Container\\Container->make() 9 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(1454): Illuminate\\Foundation\\Application->make() 10 /var/www/html/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(237): Illuminate\\Container\\Container->offsetGet() 11 /var/www/html/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(208): Illuminate\\Support\\Facades\\Facade::resolveFacadeInstance() 12 /var/www/html/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(349): Illuminate\\Support\\Facades\\Facade::getFacadeRoot() #13 /var/www/html/vendor/ashallendesign/short-url/routes/web.php(6): Illuminate\\Support\\Facades\\Facade::__callStatic() #14 /var/www/html/vendor/laravel/framework/src/Illuminate/Support/ServiceProvider.php(152): require('...') #15 /var/www/html/vendor/ashallendesign/short-url/src/Providers/ShortURLProvider.php(46): Illuminate\\Support\\ServiceProvider->loadRoutesFrom() #16 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): AshAllenDesign\\ShortURL\\Providers\\ShortURLProvider->boot() #17 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Util.php(41): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}() #18 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\\Container\\Util::unwrapIfClosure() #19 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(35): Illuminate\\Container\\BoundMethod::callBoundMethod() #20 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(662): Illuminate\\Container\\BoundMethod::call() #21 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(1028): Illuminate\\Container\\Container->call() #22 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(1009): Illuminate\\Foundation\\Application->bootProvider() #23 [internal function]: Illuminate\\Foundation\\Application->Illuminate\\Foundation\\{closure}() #24 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(1008): array_walk() #25 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/BootProviders.php(17): Illuminate\\Foundation\\Application->boot() #26 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(261): Illuminate\\Foundation\\Bootstrap\\BootProviders->bootstrap() #27 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(447): Illuminate\\Foundation\\Application->bootstrapWith() #28 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(199): Illuminate\\Foundation\\Console\\Kernel->bootstrap() #29 /var/www/html/artisan(35): Illuminate\\Foundation\\Console\\Kernel->handle() #30 {main} "}

miquelfire commented 7 months ago

Check phpinfo(). If you don't see BCMath or GMP, you'll need to solve that first.

prattcmp commented 7 months ago

Why are you closing tickets for issues that aren't resolved? I have bcmath in my phpinfo.

Screenshot 2024-03-19 at 8 31 48 AM
vinkla commented 7 months ago

As I've already stated, submit a failing test case in a pull request if you've found a bug. I'm locking this issue.