A PHP library for generating and validating CAPTCHA images to protect forms from bots.
Gregwar/Captcha is a PHP library for generating and validating CAPTCHA (Completely Automated Public Turing test to tell Computers and Humans Apart) images. It helps protect web forms from spam and automated bot submissions by creating customizable, distorted text images that are easy for humans to read but difficult for bots to decipher. The library provides a simple API to create, output, and test CAPTCHA phrases within PHP applications.
PHP developers building web applications that require form protection, such as login pages, registration forms, comment sections, or any user input areas vulnerable to spam and automated attacks.
Developers choose Gregwar/Captcha for its ease of integration, flexibility in customization, and strong anti-OCR features. It offers a lightweight, framework-agnostic solution with official extensions for Symfony and Yii2, making it a versatile choice for securing PHP applications against bots without complex dependencies.
PHP Captcha library
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
The library offers a straightforward API with methods like inline() for HTML embedding and output() for direct image serving, making it easy to add CAPTCHAs to any PHP page without complex setup.
It includes configurable distortion, lines, and scatter effects to prevent automated text recognition, as shown in the API with setDistortion() and setScatterEffect() methods for enhanced security.
Officially supported Symfony bundle and Yii2 extension are provided, allowing seamless integration with these popular PHP frameworks for developers already using them.
Supports multiple image types (JPEG, PNG, GIF) and output methods, such as saving to file or embedding inline, giving developers control over how CAPTCHAs are delivered.
The isOCRReadable() and buildAgainstOCR() methods require ocrad software, shell_exec enabled, and ImageMagick, which adds complexity and may not be available in all hosting environments.
Relies on PHP sessions for storing CAPTCHA phrases, making it less suitable for stateless APIs or applications where session management is not centralized, as shown in the demo using $_SESSION.
Focused solely on visual CAPTCHAs without support for audio alternatives or other accessibility features, limiting compliance with WCAG guidelines for users with disabilities.
Developers must actively enable anti-OCR measures and customize effects; there's no out-of-the-box AI-powered protection, which could lead to vulnerabilities if not properly implemented.