QRCode

Summary: Create QR code.
Version: 2025-12-01
Prerequisites:
Status:
Maintainer: Anomen
License: LGPL
Users: (view / edit)
Categories: Images
Discussion: QRCode-Talk

Questions answered by this recipe

How to generate QR code.

Description

Recipe creates embedded image with QR code for given text.

Installation

Download qrcode.phpΔ and phpqrcode.phpΔ lib. Store them in cookbook/ and cookbook/phpqrcode/ respectively.

In config.php, add the following line:

 include_once("$FarmD/cookbook/qrcode.php");

You need GD Graphics Library. In Ubuntu it's package php-gd. Install using command:

 sudo apt install php-gd

In Gentoo you need dev-lang/php with gd USE-flag.

Configuration

 $QR_ECLEVEL=1; // error correction level (0..3, default 1)

Usage

Use qr markup

 (:qr some 'text' here :)

 (:qr sms:(049)012-345-678 :)

 (:qr geo:49.4536,14.34552 :)

Change log / Release notes

  • 2020-12-15 - initial release
  • 2021-10-25 - update for PHP 8
  • 2025-12-01 - fixed regexp to handle spaces and multi-line texts

See also

git repository
https://github.com/anomen-s/pmwiki-recipes/tree/master/QRCode

Contributors

Comments

See discussion at QRCode-Talk

User notes : If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki.