Files
php-qrcode/Usage/Installation.html

547 lines
47 KiB
HTML
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="../">
<head>
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Installation &mdash; PHP-QRCode main
Manual</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="../_static/css/theme.css?v=9edc463e" />
<script src="../_static/jquery.js?v=5d32c60e"></script>
<script src="../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="../_static/documentation_options.js?v=a8da1a53"></script>
<script src="../_static/doctools.js?v=fd6eb6e6"></script>
<script src="../_static/sphinx_highlight.js?v=6ffebe34"></script>
<script src="../_static/js/theme.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="Quickstart" href="Quickstart.html" />
<link rel="prev" title="Overview" href="Overview.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../index.html" class="icon icon-home">
PHP-QRCode
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">Usage</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="Overview.html">Overview</a><ul>
<li class="toctree-l2"><a class="reference internal" href="Overview.html#features">Features</a></li>
<li class="toctree-l2"><a class="reference internal" href="Overview.html#requirements">Requirements</a></li>
<li class="toctree-l2"><a class="reference internal" href="Overview.html#framework-integration">Framework Integration</a></li>
<li class="toctree-l2"><a class="reference internal" href="Overview.html#shameless-advertising">Shameless advertising</a></li>
</ul>
</li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Installation</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#installation-with-composer">Installation with Composer</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#composer-json">composer.json</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#version-switch">Version switch</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="#terminal">Terminal</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#manual-installation">Manual installation</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#can-i-use-this-library-without-using-composer">Can I use this library without using composer?</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#supported-php-versions-extension-requirements">Supported PHP versions &amp; extension requirements</a></li>
<li class="toctree-l2"><a class="reference internal" href="#imagemagick">ImageMagick</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="Quickstart.html">Quickstart</a><ul>
<li class="toctree-l2"><a class="reference internal" href="Quickstart.html#import-the-library">Import the library</a></li>
<li class="toctree-l2"><a class="reference internal" href="Quickstart.html#create-your-first-qr-code">Create your first QR Code</a><ul>
<li class="toctree-l3"><a class="reference internal" href="Quickstart.html#configuration">Configuration</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="Quickstart.html#notes">Notes</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="Advanced-usage.html">Advanced usage</a><ul>
<li class="toctree-l2"><a class="reference internal" href="Advanced-usage.html#configuration-via-qroptions">Configuration via <code class="docutils literal notranslate"><span class="pre">QROptions</span></code></a><ul>
<li class="toctree-l3"><a class="reference internal" href="Advanced-usage.html#supply-an-iterable-of-options">Supply an <code class="docutils literal notranslate"><span class="pre">iterable</span></code> of options</a></li>
<li class="toctree-l3"><a class="reference internal" href="Advanced-usage.html#load-and-save-options-from-to-json">Load and save options from/to JSON</a></li>
<li class="toctree-l3"><a class="reference internal" href="Advanced-usage.html#extending-the-qroptions-class">Extending the <code class="docutils literal notranslate"><span class="pre">QROptions</span></code> class</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="Advanced-usage.html#qrcode-methods"><code class="docutils literal notranslate"><span class="pre">QRCode</span></code> methods</a><ul>
<li class="toctree-l3"><a class="reference internal" href="Advanced-usage.html#render-a-qrmatrix-instance">Render a <code class="docutils literal notranslate"><span class="pre">QRMatrix</span></code> instance</a></li>
<li class="toctree-l3"><a class="reference internal" href="Advanced-usage.html#mixed-mode">Mixed mode</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="Advanced-usage.html#common-output-options">Common output options</a><ul>
<li class="toctree-l3"><a class="reference internal" href="Advanced-usage.html#save-to-file">Save to file</a></li>
<li class="toctree-l3"><a class="reference internal" href="Advanced-usage.html#base64-uri-output">Base64 URI output</a></li>
<li class="toctree-l3"><a class="reference internal" href="Advanced-usage.html#return-the-image-resource">Return the image resource</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="Configuration-settings.html">Configuration settings</a><ul>
<li class="toctree-l2"><a class="reference internal" href="Configuration-settings.html#version">version</a></li>
<li class="toctree-l2"><a class="reference internal" href="Configuration-settings.html#versionmin">versionMin</a></li>
<li class="toctree-l2"><a class="reference internal" href="Configuration-settings.html#versionmax">versionMax</a></li>
<li class="toctree-l2"><a class="reference internal" href="Configuration-settings.html#ecclevel">eccLevel</a></li>
<li class="toctree-l2"><a class="reference internal" href="Configuration-settings.html#maskpattern">maskPattern</a></li>
<li class="toctree-l2"><a class="reference internal" href="Configuration-settings.html#addquietzone">addQuietzone</a></li>
<li class="toctree-l2"><a class="reference internal" href="Configuration-settings.html#quietzonesize">quietzoneSize</a></li>
<li class="toctree-l2"><a class="reference internal" href="Configuration-settings.html#outputinterface">outputInterface</a></li>
<li class="toctree-l2"><a class="reference internal" href="Configuration-settings.html#returnresource">returnResource</a></li>
<li class="toctree-l2"><a class="reference internal" href="Configuration-settings.html#cachefile">cachefile</a></li>
<li class="toctree-l2"><a class="reference internal" href="Configuration-settings.html#outputbase64">outputBase64</a></li>
<li class="toctree-l2"><a class="reference internal" href="Configuration-settings.html#eol">eol</a></li>
<li class="toctree-l2"><a class="reference internal" href="Configuration-settings.html#bgcolor">bgColor</a></li>
<li class="toctree-l2"><a class="reference internal" href="Configuration-settings.html#invertmatrix">invertMatrix</a></li>
<li class="toctree-l2"><a class="reference internal" href="Configuration-settings.html#drawlightmodules">drawLightModules</a></li>
<li class="toctree-l2"><a class="reference internal" href="Configuration-settings.html#drawcircularmodules">drawCircularModules</a></li>
<li class="toctree-l2"><a class="reference internal" href="Configuration-settings.html#circleradius">circleRadius</a></li>
<li class="toctree-l2"><a class="reference internal" href="Configuration-settings.html#keepassquare">keepAsSquare</a></li>
<li class="toctree-l2"><a class="reference internal" href="Configuration-settings.html#connectpaths">connectPaths</a></li>
<li class="toctree-l2"><a class="reference internal" href="Configuration-settings.html#excludefromconnect">excludeFromConnect</a></li>
<li class="toctree-l2"><a class="reference internal" href="Configuration-settings.html#modulevalues">moduleValues</a></li>
<li class="toctree-l2"><a class="reference internal" href="Configuration-settings.html#addlogospace">addLogoSpace</a></li>
<li class="toctree-l2"><a class="reference internal" href="Configuration-settings.html#logospacewidth">logoSpaceWidth</a></li>
<li class="toctree-l2"><a class="reference internal" href="Configuration-settings.html#logospaceheight">logoSpaceHeight</a></li>
<li class="toctree-l2"><a class="reference internal" href="Configuration-settings.html#logospacestartx">logoSpaceStartX</a></li>
<li class="toctree-l2"><a class="reference internal" href="Configuration-settings.html#logospacestarty">logoSpaceStartY</a></li>
<li class="toctree-l2"><a class="reference internal" href="Configuration-settings.html#scale">scale</a></li>
<li class="toctree-l2"><a class="reference internal" href="Configuration-settings.html#imagetransparent">imageTransparent</a></li>
<li class="toctree-l2"><a class="reference internal" href="Configuration-settings.html#transparencycolor">transparencyColor</a></li>
<li class="toctree-l2"><a class="reference internal" href="Configuration-settings.html#quality">quality</a></li>
<li class="toctree-l2"><a class="reference internal" href="Configuration-settings.html#gdimageuseupscale">gdImageUseUpscale</a></li>
<li class="toctree-l2"><a class="reference internal" href="Configuration-settings.html#imagickformat">imagickFormat</a></li>
<li class="toctree-l2"><a class="reference internal" href="Configuration-settings.html#cssclass">cssClass</a></li>
<li class="toctree-l2"><a class="reference internal" href="Configuration-settings.html#svgaddxmlheader">svgAddXmlHeader</a></li>
<li class="toctree-l2"><a class="reference internal" href="Configuration-settings.html#svgdefs">svgDefs</a></li>
<li class="toctree-l2"><a class="reference internal" href="Configuration-settings.html#svgpreserveaspectratio">svgPreserveAspectRatio</a></li>
<li class="toctree-l2"><a class="reference internal" href="Configuration-settings.html#svgusefillattributes">svgUseFillAttributes</a></li>
<li class="toctree-l2"><a class="reference internal" href="Configuration-settings.html#textlinestart">textLineStart</a></li>
<li class="toctree-l2"><a class="reference internal" href="Configuration-settings.html#jsonflags">jsonFlags</a></li>
<li class="toctree-l2"><a class="reference internal" href="Configuration-settings.html#fpdfmeasureunit">fpdfMeasureUnit</a></li>
<li class="toctree-l2"><a class="reference internal" href="Configuration-settings.html#xmlstylesheet">xmlStylesheet</a></li>
<li class="toctree-l2"><a class="reference internal" href="Configuration-settings.html#readeruseimagickifavailable">readerUseImagickIfAvailable</a></li>
<li class="toctree-l2"><a class="reference internal" href="Configuration-settings.html#readergrayscale">readerGrayscale</a></li>
<li class="toctree-l2"><a class="reference internal" href="Configuration-settings.html#readerinvertcolors">readerInvertColors</a></li>
<li class="toctree-l2"><a class="reference internal" href="Configuration-settings.html#readerincreasecontrast">readerIncreaseContrast</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="Reading-QRCodes.html">Reading QR Codes</a><ul>
<li class="toctree-l2"><a class="reference internal" href="Reading-QRCodes.html#basic-usage">Basic usage</a></li>
<li class="toctree-l2"><a class="reference internal" href="Reading-QRCodes.html#the-luminancesourceinterface">The <code class="docutils literal notranslate"><span class="pre">LuminanceSourceInterface</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="Reading-QRCodes.html#the-decoder">The <code class="docutils literal notranslate"><span class="pre">Decoder</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="Reading-QRCodes.html#general-considerations">General considerations</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="Logos.html">Logos and logo space</a><ul>
<li class="toctree-l2"><a class="reference internal" href="Logos.html#info">Info</a></li>
<li class="toctree-l2"><a class="reference internal" href="Logos.html#adding-a-logo-space">Adding a logo space</a></li>
</ul>
</li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Customizing output</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../Customizing/Module-Values.html">Module values</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../Customizing/Module-Values.html#basics">Basics</a></li>
<li class="toctree-l2"><a class="reference internal" href="../Customizing/Module-Values.html#assigning-values">Assigning values</a></li>
<li class="toctree-l2"><a class="reference internal" href="../Customizing/Module-Values.html#handling-in-your-own-qroutputinterface">Handling in your own <code class="docutils literal notranslate"><span class="pre">QROutputInterface</span></code></a><ul>
<li class="toctree-l3"><a class="reference internal" href="../Customizing/Module-Values.html#setting-module-values">Setting module values</a></li>
<li class="toctree-l3"><a class="reference internal" href="../Customizing/Module-Values.html#using-the-module-values">Using the module values</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../Customizing/QROutputAbstract.html"><code class="docutils literal notranslate"><span class="pre">QROutputAbstract</span></code></a><ul>
<li class="toctree-l2"><a class="reference internal" href="../Customizing/QROutputAbstract.html#properties">Properties</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../Customizing/QROutputAbstract.html#options-and-matrix"><code class="docutils literal notranslate"><span class="pre">$options</span></code> and <code class="docutils literal notranslate"><span class="pre">$matrix</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="../Customizing/QROutputAbstract.html#modulecount-scale-and-length"><code class="docutils literal notranslate"><span class="pre">$moduleCount</span></code>, <code class="docutils literal notranslate"><span class="pre">$scale</span></code> and <code class="docutils literal notranslate"><span class="pre">$length</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="../Customizing/QROutputAbstract.html#modulevalues"><code class="docutils literal notranslate"><span class="pre">$moduleValues</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="../Customizing/QROutputAbstract.html#copies-of-qroptions-values">Copies of <code class="docutils literal notranslate"><span class="pre">QROptions</span></code> values</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../Customizing/QROutputAbstract.html#methods">Methods</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../Customizing/QROutputAbstract.html#setmodulevalues"><code class="docutils literal notranslate"><span class="pre">setModuleValues()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="../Customizing/QROutputAbstract.html#modulevalueisvalid"><code class="docutils literal notranslate"><span class="pre">moduleValueIsValid()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="../Customizing/QROutputAbstract.html#preparemodulevalue"><code class="docutils literal notranslate"><span class="pre">prepareModuleValue()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="../Customizing/QROutputAbstract.html#getdefaultmodulevalue"><code class="docutils literal notranslate"><span class="pre">getDefaultModuleValue()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="../Customizing/QROutputAbstract.html#getmodulevalue-and-getmodulevalueat"><code class="docutils literal notranslate"><span class="pre">getModuleValue()</span></code> and <code class="docutils literal notranslate"><span class="pre">getModuleValueAt()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="../Customizing/QROutputAbstract.html#setmatrixdimensions"><code class="docutils literal notranslate"><span class="pre">setMatrixDimensions()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="../Customizing/QROutputAbstract.html#getoutputdimensions"><code class="docutils literal notranslate"><span class="pre">getOutputDimensions()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="../Customizing/QROutputAbstract.html#collectmodules"><code class="docutils literal notranslate"><span class="pre">collectModules()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="../Customizing/QROutputAbstract.html#savetofile-and-tobase64datauri"><code class="docutils literal notranslate"><span class="pre">saveToFile()</span></code> and <code class="docutils literal notranslate"><span class="pre">toBase64DataURI()</span></code></a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../Customizing/Custom-output-interface.html">Custom <code class="docutils literal notranslate"><span class="pre">QROutputInterface</span></code></a><ul>
<li class="toctree-l2"><a class="reference internal" href="../Customizing/Custom-output-interface.html#class-skeleton">Class skeleton</a></li>
<li class="toctree-l2"><a class="reference internal" href="../Customizing/Custom-output-interface.html#module-values">Module values</a></li>
<li class="toctree-l2"><a class="reference internal" href="../Customizing/Custom-output-interface.html#transform-the-output">Transform the output</a></li>
<li class="toctree-l2"><a class="reference internal" href="../Customizing/Custom-output-interface.html#run-the-custom-output">Run the custom output</a></li>
<li class="toctree-l2"><a class="reference internal" href="../Customizing/Custom-output-interface.html#summary">Summary</a></li>
</ul>
</li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Built-In Output Classes</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../Built-In-Output/QREps.html">QREps</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../Built-In-Output/QREps.html#example">Example</a></li>
<li class="toctree-l2"><a class="reference internal" href="../Built-In-Output/QREps.html#additional-methods">Additional methods</a></li>
<li class="toctree-l2"><a class="reference internal" href="../Built-In-Output/QREps.html#options-that-affect-this-class">Options that affect this class</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../Built-In-Output/QRFpdf.html">QRFpdf</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../Built-In-Output/QRFpdf.html#example">Example</a></li>
<li class="toctree-l2"><a class="reference internal" href="../Built-In-Output/QRFpdf.html#additional-methods">Additional methods</a></li>
<li class="toctree-l2"><a class="reference internal" href="../Built-In-Output/QRFpdf.html#options-that-affect-this-class">Options that affect this class</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../Built-In-Output/QRGdImage.html">QRGdImage</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../Built-In-Output/QRGdImage.html#example">Example</a></li>
<li class="toctree-l2"><a class="reference internal" href="../Built-In-Output/QRGdImage.html#additional-methods">Additional methods</a></li>
<li class="toctree-l2"><a class="reference internal" href="../Built-In-Output/QRGdImage.html#options-that-affect-this-class">Options that affect this class</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../Built-In-Output/QRImagick.html">QRImagick</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../Built-In-Output/QRImagick.html#example">Example</a></li>
<li class="toctree-l2"><a class="reference internal" href="../Built-In-Output/QRImagick.html#additional-methods">Additional methods</a></li>
<li class="toctree-l2"><a class="reference internal" href="../Built-In-Output/QRImagick.html#options-that-affect-this-class">Options that affect this class</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../Built-In-Output/QRInterventionImage.html">QRInterventionImage</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../Built-In-Output/QRInterventionImage.html#example">Example</a></li>
<li class="toctree-l2"><a class="reference internal" href="../Built-In-Output/QRInterventionImage.html#additional-methods">Additional methods</a></li>
<li class="toctree-l2"><a class="reference internal" href="../Built-In-Output/QRInterventionImage.html#options-that-affect-this-class">Options that affect this class</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../Built-In-Output/QRMarkupHTML.html">QRMarkupHTML</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../Built-In-Output/QRMarkupHTML.html#example">Example</a></li>
<li class="toctree-l2"><a class="reference internal" href="../Built-In-Output/QRMarkupHTML.html#additional-methods">Additional methods</a></li>
<li class="toctree-l2"><a class="reference internal" href="../Built-In-Output/QRMarkupHTML.html#options-that-affect-this-class">Options that affect this class</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../Built-In-Output/QRMarkupSVG.html">QRMarkupSVG</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../Built-In-Output/QRMarkupSVG.html#example">Example</a></li>
<li class="toctree-l2"><a class="reference internal" href="../Built-In-Output/QRMarkupSVG.html#additional-methods">Additional methods</a></li>
<li class="toctree-l2"><a class="reference internal" href="../Built-In-Output/QRMarkupSVG.html#options-that-affect-this-class">Options that affect this class</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../Built-In-Output/QRMarkupXML.html">QRMarkupXML</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../Built-In-Output/QRMarkupXML.html#example">Example</a></li>
<li class="toctree-l2"><a class="reference internal" href="../Built-In-Output/QRMarkupXML.html#additional-methods">Additional methods</a></li>
<li class="toctree-l2"><a class="reference internal" href="../Built-In-Output/QRMarkupXML.html#options-that-affect-this-class">Options that affect this class</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../Built-In-Output/QRStringJSON.html">QRStringJSON</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../Built-In-Output/QRStringJSON.html#example">Example</a></li>
<li class="toctree-l2"><a class="reference internal" href="../Built-In-Output/QRStringJSON.html#previous-functionality">Previous functionality</a></li>
<li class="toctree-l2"><a class="reference internal" href="../Built-In-Output/QRStringJSON.html#additional-methods">Additional methods</a></li>
<li class="toctree-l2"><a class="reference internal" href="../Built-In-Output/QRStringJSON.html#options-that-affect-this-class">Options that affect this class</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../Built-In-Output/QRStringText.html">QRStringText</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../Built-In-Output/QRStringText.html#example">Example</a></li>
<li class="toctree-l2"><a class="reference internal" href="../Built-In-Output/QRStringText.html#additional-methods">Additional methods</a></li>
<li class="toctree-l2"><a class="reference internal" href="../Built-In-Output/QRStringText.html#options-that-affect-this-class">Options that affect this class</a></li>
</ul>
</li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Appendix</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../Appendix/Terminology.html">Terminology</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../Appendix/Terminology.html#qr-code">QR Code</a></li>
<li class="toctree-l2"><a class="reference internal" href="../Appendix/Terminology.html#matrix">Matrix</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../Appendix/Terminology.html#module">Module</a></li>
<li class="toctree-l3"><a class="reference internal" href="../Appendix/Terminology.html#version">Version</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../Appendix/Terminology.html#function-patterns">Function Patterns</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../Appendix/Terminology.html#finder-pattern">Finder Pattern</a></li>
<li class="toctree-l3"><a class="reference internal" href="../Appendix/Terminology.html#alignment-pattern">Alignment Pattern</a></li>
<li class="toctree-l3"><a class="reference internal" href="../Appendix/Terminology.html#timing-pattern">Timing Pattern</a></li>
<li class="toctree-l3"><a class="reference internal" href="../Appendix/Terminology.html#separators">Separators</a></li>
<li class="toctree-l3"><a class="reference internal" href="../Appendix/Terminology.html#quiet-zone">Quiet Zone</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../Appendix/Terminology.html#encoding-region">Encoding Region</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../Appendix/Terminology.html#data">Data</a></li>
<li class="toctree-l3"><a class="reference internal" href="../Appendix/Terminology.html#version-information">Version Information</a></li>
<li class="toctree-l3"><a class="reference internal" href="../Appendix/Terminology.html#format-information">Format Information</a></li>
<li class="toctree-l3"><a class="reference internal" href="../Appendix/Terminology.html#darkmodule">Darkmodule</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../Appendix/Terminology.html#mode">Mode</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../Appendix/Terminology.html#segment">Segment</a></li>
<li class="toctree-l3"><a class="reference internal" href="../Appendix/Terminology.html#extended-channel-interpretation-eci">Extended Channel Interpretation (ECI)</a></li>
<li class="toctree-l3"><a class="reference internal" href="../Appendix/Terminology.html#mixed-mode">Mixed Mode</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../Appendix/Terminology.html#ecc-error-correction-coding">ECC (Error Correction Coding)</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../Appendix/Terminology.html#ecc-level">ECC Level</a></li>
<li class="toctree-l3"><a class="reference internal" href="../Appendix/Terminology.html#maximum-data-capacity">Maximum data capacity</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../Appendix/Terminology.html#data-masking">Data masking</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../Appendix/Terminology.html#evaluation">Evaluation</a></li>
<li class="toctree-l3"><a class="reference internal" href="../Appendix/Terminology.html#mask-pattern">Mask pattern</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../Appendix/Terminology.html#reflectance">Reflectance</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../Appendix/URI-Content.html">Popular content and URI schemes</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../Appendix/URI-Content.html#url-https">URL <code class="docutils literal notranslate"><span class="pre">https</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../Appendix/URI-Content.html#e-mail-mailto">E-Mail <code class="docutils literal notranslate"><span class="pre">mailto</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../Appendix/URI-Content.html#phone-numbers-tel">Phone numbers <code class="docutils literal notranslate"><span class="pre">tel</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../Appendix/URI-Content.html#geo-coordinates-geo">Geo Coordinates <code class="docutils literal notranslate"><span class="pre">geo</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../Appendix/URI-Content.html#mobile-authenticators-otpauth">Mobile Authenticators <code class="docutils literal notranslate"><span class="pre">otpauth</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../Appendix/URI-Content.html#wireless-network-configuration">Wireless Network configuration</a></li>
<li class="toctree-l2"><a class="reference internal" href="../Appendix/URI-Content.html#contact-information-vcard">Contact information: vCard</a></li>
<li class="toctree-l2"><a class="reference internal" href="../Appendix/URI-Content.html#calendar-events-vcalendar-and-icalendar">Calendar Events: vCalendar and iCalendar</a></li>
<li class="toctree-l2"><a class="reference internal" href="../Appendix/URI-Content.html#credit-transfer">Credit Transfer</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../Appendix/URI-Content.html#sepa-european-payments-council">SEPA (European Payments Council)</a></li>
<li class="toctree-l3"><a class="reference internal" href="../Appendix/URI-Content.html#pix-banco-central-do-brasil">Pix (Banco Central do Brasil)</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../Appendix/URI-Content.html#see-also">See also</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../Appendix/Performance-considerations.html">Performance considerations</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../Appendix/Performance-considerations.html#version">Version</a></li>
<li class="toctree-l2"><a class="reference internal" href="../Appendix/Performance-considerations.html#ecc-level">Ecc level</a></li>
<li class="toctree-l2"><a class="reference internal" href="../Appendix/Performance-considerations.html#data-mode">Data mode</a></li>
<li class="toctree-l2"><a class="reference internal" href="../Appendix/Performance-considerations.html#mask-pattern">Mask pattern</a></li>
<li class="toctree-l2"><a class="reference internal" href="../Appendix/Performance-considerations.html#output">Output</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../Appendix/Contribute.html">How to contribute</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../Appendix/Contribute.html#questions-and-issues">Questions and issues</a></li>
<li class="toctree-l2"><a class="reference internal" href="../Appendix/Contribute.html#bug-reports">Bug reports</a></li>
<li class="toctree-l2"><a class="reference internal" href="../Appendix/Contribute.html#pull-requests-and-bug-fixes">Pull requests and bug fixes</a></li>
<li class="toctree-l2"><a class="reference internal" href="../Appendix/Contribute.html#documentation">Documentation</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../Appendix/License.html">License</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../index.html">PHP-QRCode</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="../index.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item active">Installation</li>
<li class="wy-breadcrumbs-aside">
<a href="https://github.com/chillerlan/php-qrcode/blob/main/docs/Usage/Installation.md" class="fa fa-github"> Edit on GitHub</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<section id="installation">
<h1>Installation<a class="headerlink" href="#installation" title="Link to this heading"></a></h1>
<section id="installation-with-composer">
<h2>Installation with Composer<a class="headerlink" href="#installation-with-composer" title="Link to this heading"></a></h2>
<p><strong><a class="reference external" href="https://getcomposer.org">Composer</a> is required to install this package. Please do not open an issue to complain about “monopolizing the implementation” or similar - weve been there before.</strong></p>
<section id="composer-json">
<h3>composer.json<a class="headerlink" href="#composer-json" title="Link to this heading"></a></h3>
<p>Installation via <a class="reference external" href="https://getcomposer.org/doc/04-schema.md"><code class="docutils literal notranslate"><span class="pre">composer.json</span></code></a>:</p>
<div class="highlight-json notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;require&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;php&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;^8.2&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;chillerlan/php-qrcode&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;dev-main&quot;</span>
<span class="w"> </span><span class="p">}</span>
<span class="p">}</span>
</pre></div>
</div>
<p>Note: replace <code class="docutils literal notranslate"><span class="pre">dev-main</span></code> with a <a class="reference external" href="https://getcomposer.org/doc/articles/versions.md#writing-version-constraints">version constraint</a>, e.g. <code class="docutils literal notranslate"><span class="pre">^4.3</span></code> - see <a class="reference external" href="https://github.com/chillerlan/php-qrcode/releases">releases</a> for valid versions.
In case you want to keep using <code class="docutils literal notranslate"><span class="pre">dev-main</span></code>, specify the hash of a commit to avoid running into unforseen issues, like so: <code class="docutils literal notranslate"><span class="pre">dev-main#cb69751c3bc090a7fdd2f2601bbe10f28d225f10</span></code></p>
<section id="version-switch">
<h4>Version switch<a class="headerlink" href="#version-switch" title="Link to this heading"></a></h4>
<p>If your application supports older PHP versions and uses the basic <code class="docutils literal notranslate"><span class="pre">QRCode</span></code> syntax <code class="docutils literal notranslate"><span class="pre">new</span> <span class="pre">QRCode()-&gt;render($data)</span></code>, then you can add a version switch to your <code class="docutils literal notranslate"><span class="pre">composer.json</span></code> to allow installing a <code class="docutils literal notranslate"><span class="pre">php-qrcode</span></code> version that suits the platform it runs on:</p>
<div class="highlight-json notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;require&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;php&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;^7.0 || ^8.0&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;chillerlan/php-qrcode&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;^2.0 || ^3.4 || ^4.3 || ^5.0&quot;</span>
<span class="w"> </span><span class="p">}</span>
<span class="p">}</span>
</pre></div>
</div>
<p>Most of the v2.0 API remains unchanged throughout the several versions up to v5.x, however, please test and verify the expected output before you deploy such a switch.</p>
</section>
</section>
<section id="terminal">
<h3>Terminal<a class="headerlink" href="#terminal" title="Link to this heading"></a></h3>
<p>To install <code class="docutils literal notranslate"><span class="pre">php-qrcode</span></code> on the terminal, use:</p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>composer<span class="w"> </span>require<span class="w"> </span>chillerlan/php-qrcode
</pre></div>
</div>
<p>If you want to install the package from a specific tag or commit, do as follows:</p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>composer<span class="w"> </span>require<span class="w"> </span>chillerlan/php-qrcode:4.3.4
composer<span class="w"> </span>require<span class="w"> </span>chillerlan/php-qrcode:dev-main#f15b0afe9d4128bf734c3bf1bcffae72bf7b3e53
</pre></div>
</div>
</section>
</section>
<section id="manual-installation">
<h2>Manual installation<a class="headerlink" href="#manual-installation" title="Link to this heading"></a></h2>
<p>Download the desired version of the package from <a class="reference external" href="https://github.com/chillerlan/php-qrcode/archive/refs/heads/main.zip">main</a> or
<a class="reference external" href="https://github.com/chillerlan/php-qrcode/releases">release</a> and extract the contents to your project folder.
After that, run <code class="docutils literal notranslate"><span class="pre">composer</span> <span class="pre">install</span></code> in the package root directory to install the required dependencies and generate <code class="docutils literal notranslate"><span class="pre">./vendor/autoload.php</span></code>.</p>
<p>Profit!</p>
<section id="can-i-use-this-library-without-using-composer">
<h3>Can I use this library without using composer?<a class="headerlink" href="#can-i-use-this-library-without-using-composer" title="Link to this heading"></a></h3>
<p>You can, but its absolutely not recommended, nor supported.</p>
<p>With that said, Ill leave you with this info:</p>
<ul class="simple">
<li><p>download the .zip for a version of your choice and also all required dependencies listed in the <code class="docutils literal notranslate"><span class="pre">composer.json</span></code> for that version (you can find links to the respective repos <a class="reference external" href="https://packagist.org/packages/chillerlan/php-qrcode">on packagist</a>)</p></li>
<li><p>extract the files into your library folder</p></li>
<li><p>include the files manually or with whatever autoloader you are using</p></li>
</ul>
<p>Good luck!</p>
</section>
</section>
<section id="supported-php-versions-extension-requirements">
<h2>Supported PHP versions &amp; extension requirements<a class="headerlink" href="#supported-php-versions-extension-requirements" title="Link to this heading"></a></h2>
<p>The PHP built-in extensions <a class="reference external" href="https://www.php.net/manual/book.image.php">GdImage</a> and <a class="reference external" href="https://www.php.net/manual/book.mbstring.php">mbstring</a> are used across all versions, <a class="reference external" href="https://www.php.net/manual/book.imagick.php">ImageMagick</a> is optional since v3.x.</p>
<table class="docutils align-default">
<thead>
<tr class="row-odd"><th class="head"><p>version</p></th>
<th class="head"><p>branch/tag</p></th>
<th class="head"><p>PHP</p></th>
<th class="head"><p>supported</p></th>
<th class="head"><p>required extensions</p></th>
<th class="head"><p>optional extensions</p></th>
<th class="head"><p>info</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p><strong>v7</strong></p></td>
<td><p><a class="reference external" href="https://github.com/chillerlan/php-qrcode/tree/main"><code class="docutils literal notranslate"><span class="pre">dev-main</span></code></a></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">^8.4</span></code></p></td>
<td><p>-</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">mbstring</span></code></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">gd</span></code> or <code class="docutils literal notranslate"><span class="pre">imagick</span></code> required for reading QR Codes, <code class="docutils literal notranslate"><span class="pre">fileinfo</span></code> is used in <code class="docutils literal notranslate"><span class="pre">QRImagick</span></code></p></td>
<td><p></p></td>
</tr>
<tr class="row-odd"><td><p><strong>v6</strong></p></td>
<td><p><a class="reference external" href="https://github.com/chillerlan/php-qrcode/tree/v6.0.x"><code class="docutils literal notranslate"><span class="pre">6.x</span></code></a></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">^8.2</span></code></p></td>
<td><p>yes</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">mbstring</span></code></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">gd</span></code> or <code class="docutils literal notranslate"><span class="pre">imagick</span></code> required for reading QR Codes, <code class="docutils literal notranslate"><span class="pre">fileinfo</span></code> is used in <code class="docutils literal notranslate"><span class="pre">QRImagick</span></code></p></td>
<td><p></p></td>
</tr>
<tr class="row-even"><td><p><strong>v5</strong></p></td>
<td><p><a class="reference external" href="https://github.com/chillerlan/php-qrcode/tree/v5.0.x"><code class="docutils literal notranslate"><span class="pre">5.x</span></code></a></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">^7.4 || ^8.0</span></code></p></td>
<td><p>yes</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">mbstring</span></code></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">gd</span></code> or <code class="docutils literal notranslate"><span class="pre">imagick</span></code> required for reading QR Codes, <code class="docutils literal notranslate"><span class="pre">fileinfo</span></code> is used in <code class="docutils literal notranslate"><span class="pre">QRImagick</span></code></p></td>
<td><p></p></td>
</tr>
<tr class="row-odd"><td><p><strong>v4</strong></p></td>
<td><p><a class="reference external" href="https://github.com/chillerlan/php-qrcode/tree/v4.3.x"><code class="docutils literal notranslate"><span class="pre">4.4.2</span></code></a></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">^7.4 || ^8.0</span></code></p></td>
<td><p>no</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">gd</span></code>, <code class="docutils literal notranslate"><span class="pre">mbstring</span></code></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">imagick</span></code></p></td>
<td><p></p></td>
</tr>
<tr class="row-even"><td><p><strong>v3</strong></p></td>
<td><p><a class="reference external" href="https://github.com/chillerlan/php-qrcode/tree/v3.2.x"><code class="docutils literal notranslate"><span class="pre">3.4.1</span></code></a></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">^7.2</span></code></p></td>
<td><p>no</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">gd</span></code>, <code class="docutils literal notranslate"><span class="pre">mbstring</span></code></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">imagick</span></code></p></td>
<td><p>v3.4.1 also supports PHP8</p></td>
</tr>
<tr class="row-odd"><td><p><strong>v2</strong></p></td>
<td><p><a class="reference external" href="https://github.com/chillerlan/php-qrcode/tree/v2.0.x"><code class="docutils literal notranslate"><span class="pre">2.0.8</span></code></a></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">&gt;=7.0.3</span></code></p></td>
<td><p>no</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">gd</span></code>, <code class="docutils literal notranslate"><span class="pre">mbstring</span></code></p></td>
<td><p></p></td>
<td><p></p></td>
</tr>
<tr class="row-even"><td><p><strong>v1</strong></p></td>
<td><p><a class="reference external" href="https://github.com/chillerlan/php-qrcode/tree/v2.0.x-php5"><code class="docutils literal notranslate"><span class="pre">1.0.9</span></code></a></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">&gt;=5.6</span></code></p></td>
<td><p>no</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">gd</span></code>, <code class="docutils literal notranslate"><span class="pre">mbstring</span></code></p></td>
<td><p></p></td>
<td><p>please let PHP 5 die!</p></td>
</tr>
</tbody>
</table>
<p>PSA: <a class="reference external" href="https://www.php.net/supported-versions.php">PHP versions &lt; 8.0 are EOL</a> and therefore the respective <code class="docutils literal notranslate"><span class="pre">QRCode</span></code> versions are also no longer supported!</p>
</section>
<section id="imagemagick">
<h2>ImageMagick<a class="headerlink" href="#imagemagick" title="Link to this heading"></a></h2>
<p>Please follow the installation guides for your operating system:</p>
<ul class="simple">
<li><p>ImageMagick: <a class="reference external" href="https://imagemagick.org/script/download.php">imagemagick.org/script/download.php</a></p></li>
<li><p>PHP <code class="docutils literal notranslate"><span class="pre">ext-imagick</span></code>: <a class="reference external" href="https://github.com/Imagick/imagick">github.com/Imagick/imagick</a> (<a class="reference external" href="https://mlocati.github.io/articles/php-windows-imagick.html">Windows downloads</a>)</p></li>
</ul>
</section>
</section>
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="Overview.html" class="btn btn-neutral float-left" title="Overview" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="Quickstart.html" class="btn btn-neutral float-right" title="Quickstart" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>
<div role="contentinfo">
<p>&#169; Copyright 2026, smiley.</p>
</div>
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>