PHPackages                             mobicms/captcha - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Validation &amp; Sanitization](/categories/validation)
4. /
5. mobicms/captcha

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

mobicms/captcha
===============

A simple PHP CAPTCHA library

5.2.0(8mo ago)2616.4k↑43.1%52MITPHPPHP ~8.2 || ~8.3 || ~8.4CI passing

Since Sep 1Pushed 2mo ago2 watchersCompare

[ Source](https://github.com/mobicms/captcha)[ Packagist](https://packagist.org/packages/mobicms/captcha)[ RSS](/packages/mobicms-captcha/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (9)Dependencies (4)Versions (10)Used By (2)

`mobicms/captcha`
=================

[](#mobicmscaptcha)

[![GitHub](https://camo.githubusercontent.com/a821cf728820f26bb760a6bdb04a4582f883a8665b7364c2e2daa8e899fb8769/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6d6f6269636d732f636170746368613f636f6c6f723d677265656e)](https://github.com/mobicms/captcha/blob/main/LICENSE)[![GitHub release (latest SemVer)](https://camo.githubusercontent.com/7c348555af406e46a039a59fbda84a5ad196da82108da1d69fba8d08694d81fb/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f6d6f6269636d732f63617074636861)](https://github.com/mobicms/captcha/releases)[![Packagist](https://camo.githubusercontent.com/b4ba6aa004c97374494feb9ec91cc839b826ea45224667e21a834f7cd24de60f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d6f6269636d732f63617074636861)](https://packagist.org/packages/mobicms/captcha)

[![CI-Analysis](https://github.com/mobicms/captcha/workflows/analysis/badge.svg)](https://github.com/mobicms/captcha/actions?query=workflow%3AAnalysis)[![CI-Tests](https://github.com/mobicms/captcha/workflows/tests/badge.svg)](https://github.com/mobicms/captcha/actions?query=workflow%3ATests)[![Sonar Coverage](https://camo.githubusercontent.com/981556bf0dbc6051699639f7bc52c015630c3846e058d2ba8be20d9b237cc004/68747470733a2f2f696d672e736869656c64732e696f2f736f6e61722f636f7665726167652f6d6f6269636d735f636170746368613f7365727665723d6874747073253341253246253246736f6e6172636c6f75642e696f)](https://sonarcloud.io/code?id=mobicms_captcha)[![Quality Gate Status](https://camo.githubusercontent.com/59ea6bd822809de10963d19189e18e64e843847905b6bf85c937ef6814e302e8/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d6d6f6269636d735f63617074636861266d65747269633d616c6572745f737461747573)](https://sonarcloud.io/summary/overall?id=mobicms_captcha)

This library is a simple PHP CAPTCHA. Prevent form spam by generating random Captcha images.

Major features:

- lightweight and fast
- not create any temporary files
- there are many settings that allow you to change the look of the picture
- you can use your own font sets

Example:

[![Captchas examples](docs/images/captcha_example.png)](docs/images/captcha_example.png)

Installation
------------

[](#installation)

The preferred method of installation is via [Composer](http://getcomposer.org). Run the following command to install the package and add it as a requirement to your project's `composer.json`:

```
composer require mobicms/captcha

```

Run DEMO
--------

[](#run-demo)

Compose and run the Docker container.
The demo page will be available on:

- Using make

```
make up
```

- Or using Docker CLI

```
docker compose up -d
```

Usage
-----

[](#usage)

### Simply example

[](#simply-example)

A working example here: `docs/demo/example1`

1. Display in form:

```
