Skip to content

Instantly share code, notes, and snippets.

Created March 9, 2014 10:28
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save janikvonrotz/9445729 to your computer and use it in GitHub Desktop.
Ubuntu: Install QR code service #PHP #Nginx #Markdown


To generate QR codes with php we are using the project QR Generator PHP hosted on GitHub.


  • Ubuntu server
  • Nginx
  • Nginx minimal website
  • php5-fpm
  • Nginx php5-fpm website


Clone project with git.

cd /usr/local/src
sudo git clone

Rename the project directory to get a shorter url.

sudo mv QR-Generator-PHP qr

Add the config to one of your Nginx sites.

    # change location for QR code requests
    location /qr{
        root /usr/local/src;
        index index.php;
    location ~ .php$ {
        # change the php root for QR code requests
        if ($request_uri ~* /qr) {
            set $php_root /usr/local/src;

Test config and reload Nginx service.

sudo nginx -t && sudo service nginx reload

Test the new QR code service by open a browser on //[host]/qr/?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment