Open hrace009 opened 2 years ago
I have the same problem. Works fine on php 8.0
yeah, last time i use php7.4 it working fine, but when i switch to php8.1 the code show very long time
Can confirm this, switched from working PHP7.4 to PHP8.1 (tried laravel8 and laravel9), same effect. as soon as I switch PHP to 8.1 the whole page speed is ruined.
Not usable in production. @igoshev any idea where things go wrong / can you take a look into?
@igoshev please make a fix for this
i don't see any respond from @igoshev
seems we must make our own fix for this package
@tm1000 any idea maybe since you pushed the commit for laravel9?
unusable for PHP8.1
@some0ne2 if you look at my commit you can see that I only bumped the composer file
Regardless my company has five services that use this on php 8.1 for the last two-three months and we've experienced no issues
@tm1000 Thanks for information, what laravel version and what PHP version exactly are you using?
Laravel 9 and php 8.1.7
My coworker was confused on what I was asking. Yes we are experiencing the slowness too. The issue is all of the math in https://github.com/igoshev/laravel-captcha/blob/6694a98ed72f58e9c896308cd3fbd29a225937f9/src/Captcha/Generator/GeneratorWaves.php#L68-L136
On individual runs it takes about 0.002 seconds. However once you multiply that by each of the foreachs such as the width (120) and height (80) you get 20 seconds. The smaller the image the less time it would take.
Instead of looking into this further I just switched to: https://github.com/mewebstudio/captcha
Not the ideal solution but it works for now.
@tm1000 Thanks for update, any idea why this might occur only when we switch to PHP8.1? Yes I know mewebstudio, but for us this is not ideal too, that's why we switched to this captcha lib.
@some0ne2 it's a bug in php not anything with this library. The math functions are slightly slower in php 8.1 and thus causes slowdowns.
The solution here is probably to replace WaveGenerator with code that uses https://github.com/Intervention/image to generate a similar image (this is what mewebstudio does)
The math however is used to create the wavy text
Did they replace the wave generator because of the bug in PHP8.1 too?
@some0ne2 they dont use WaveGenerator. WaveGenerator is exclusive to this library
Someone with free time available? Would provide some cups of coffee (tips) for fixing :).
i think we should upgrade to PHP 8.2
@hrace009 Not released, anybody an update on to this? @tm1000 Thanks for verification, is this bug documented somewhere on PHP bugtracker?
@some0ne2 i have seen PHP 8.2 somewhere, but still in dev mode
hi every body Still haven't found a solution for this?
Any update onto this? Someone tried 8.2 release of PHP?
I switched captcha providers
@tm1000 any recommendation?
Captcha show with very long time, i don't know why, but this is using localhost with xampp and php 8.1![image](https://user-images.githubusercontent.com/7691118/163419505-6471f1d1-0bcf-49c6-b933-5ff2444bacf4.png)