igoshev / laravel-captcha

Captcha integration for the Laravel
https://laravel.bonecms.tech/laravel-captcha
MIT License
79 stars 35 forks source link

php 8.1 issue #51

Closed MrMooky closed 2 years ago

MrMooky commented 2 years ago

I just updated my production server to php 8.1 and noticed, that the captcha is not working correctly anymore. For some reason it works locally, but takes about 5-8 seconds to load. Had no issue with php 8.0 before.

On my live server, I get the following exception and no image is being generated:

production.ERROR: Call to undefined function Igoshev\Captcha\Captcha\Generator\ImageTTFtext() {"exception":"[object] (Error(code: 0): Call to undefined function Igoshev\Captcha\Captcha\Generator\ImageTTFtext() at /home/xxx/webapps/xxx/releases/20220128154920/vendor/bonecms/laravel-captcha/src/Captcha/Generator/GeneratorWaves.php:30)

Screenshot 2022-01-28 at 16 52 35 Screenshot 2022-01-28 at 16 56 17
tm1000 commented 2 years ago

You need to install php-gd.

MrMooky commented 2 years ago

I don't understand why this was closed. Like I said, it is working fine with PHP 8.0 but has issues with 8.1.

tm1000 commented 2 years ago

@MrMooky its closed because it's looking for global functions but not finding them so it's falling back to the namespace

The global functions it's looking for are part of php-gd. You did not compile php gd with the right set of requirements or it's not installed.

I'm using this with php 8.1 currently and it works fine

See: https://www.php.net/manual/en/function.imagettftext.php

some0ne2 commented 8 months ago

@MrMooky @tm1000 updated to php8.2, problem still persists. @igoshev are you active here?