Download the PHP package olakunlevpn/phpcapcha without Composer

On this page you can find all versions of the php package olakunlevpn/phpcapcha. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package phpcapcha

Advanced PHP Captcha

PHP Captcha is an elegant, highly customizable, and secure captcha generator for PHP 8.0+. It supports advanced features like wave distortion, mathematical challenges, granular noise control, and custom font management.

Designed to be simple to use but powerful enough for any security requirement.

Requirements

Features

Installation

You can install the package via composer:

Basic Usage

Here is the quickest way to get a captcha up and running:

Advanced Usage

Customizing Appearance

You can chain methods to configure the captcha exactly how you want it.

Math Challenge Mode

Instead of asking users to read distorted text, ask them to solve a simple math problem.

Granular Noise & Distortion Control

You have full control over the security elements.

To create a Clean captcha (easier for humans, less secure against bots):

Saving to File

Useful for caching or generating static assets.

Inline Base64

Useful for passing the image directly to a view or API response without a separate endpoint.

Validation

Validation is straightforward. Simply compare the user's input against the stored code.

API Reference

Method Description
setFont(string $path) Path to a .ttf file OR a directory containing fonts (random selection).
setTextColor(int $r, int $g, int $b) Sets the RGB color of the text.
setBackgroundColor(int $r, int $g, int $b) Sets the RGB color of the background.
setLength(int $length) Number of characters to generate (ignored in Math mode).
setType(string $type) mixed (default), alpha, numeric, or math.
setNoise(bool $enable, int $count) Toggle dots noise and set quantity.
setLines(bool $enable, int $count) Toggle random lines and set quantity.
setDistortion(bool $enable, int $amp, int $period) Toggle wave distortion. Amplitude/Period control wave shape.
create(int $width, int $height) Generates the image resource. Must be called before output.
output() Headers + Image binary stream (PNG).
getBase64() Returns Base64 encoded string of the image.
save(string $path) Saves the image to the specified file path.
getCode() Returns the correct answer/code for validation.

Examples

Check the examples/ directory for full implementations:

AI assistant integration

This repository includes an AGENTS.md file specifically designed for AI assistants (like GitHub Copilot, Cursor, or Claude). If you're using an AI tool to help with your Laravel project:

Example prompts for AI assistants:

License

The MIT License (MIT). Please see License File for more information.


All versions of phpcapcha with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
ext-gd Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package olakunlevpn/phpcapcha contains the following files

Loading the files please wait ...