Giter VIP home page Giter VIP logo

linux-php-barcode-reader-'s Introduction

PHP Barcode Reader for Linux

Version 7.0

The sample demonstrates how to make PHP barcode reader with PHP7 and Dynamsoft Barcode Reader for Linux.

License

Get the trial license.

Installation

  • php7.0-cli, php7.0-dev, libxml2-dev

    sudo apt-get install php7.0-cli php7.0-dev libxml2-dev
    
  • php-7.0.30 source code

  • Dynamsoft Barcode Reader SDK

    tar xvf dbr-linux-7.0.tar.gz
    sudo cp ./Dynamsoft/BarcodeReader/lib/WITHOUTSTDC++LIB/libDynamsoftBarcodeReader.so /usr/lib/
    

How to Build the Extension

  1. Unzip PHP source code and then change directory to ext:

    tar xvf php-7.0.30.tar.gz
    cd ~/php-7.0.30/ext/
    
  2. Create an extension folder:

    ./ext_skel --extname=dbr
    cd dbr
    
  3. Copy AllSupportedBarcodeTypes.tif, config.m4, DynamsoftBarcodeReader.h, reader.php and dbr.c to ~/php-7.0.30/ext/dbr:

  4. Copy php.ini to /etc/php/7.0/cli/php.ini.

  5. Build and install the extension:

    phpize
    ./configure
    make
    sudo make install
    
  6. Get a trial license and set it in reader.php:

    DBRInitLicense("LICENSE-KEY");
  7. Run reader.php:

    php -c /etc/php/7.0/cli/php.ini reader.php
    

    php barcode reader

Online Barcode Reader with PHP Custom Extension

Get the source code and deploy it to any web server.

php online barcode reader

PHP on Apache

  1. Install php7.0-curl, apache2 and libapache2-mod-php7.0:

    sudo apt-get install php7.0-curl apache2 libapache2-mod-php7.0
    
  2. Add extension to /etc/php/7.0/apache2/php.ini :

    extension=dbr.so
    
  3. Get write permissions:

    sudo chgrp -R www-data /var/www/html/reader
    sudo chmod -R g+rw /var/www/html/reader
    
  4. Start Apache:

    sudo service apache2 start
    #sudo service apache2 stop // if you want to stop Apache
    
  5. Visit http://localhost/reader/index.php.

PHP on Nginx

  1. Install Nginx and php7.0-cgi:

    sudo apt-get install nginx php7.0-cgi
    
  2. Enable PHP in configuration file:

    sudo vi /etc/nginx/sites-available/default
    
    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    
    location ~ \.php$ {
            include snippets/fastcgi-php.conf;
    
            # With php7.0-cgi alone:
            fastcgi_pass 127.0.0.1:9000;
            # With php7.0-fpm:
            #fastcgi_pass unix:/run/php/php7.0-fpm.sock;
    }
    
  3. Get write permissions:

    sudo chgrp -R www-data /usr/share/nginx/html/reader
    sudo chmod -R g+rw /usr/share/nginx/html/reader
    
  4. Run Nginx and php-cgi:

    sudo nginx
    # sudo nginx โ€“s stop // if you want to stop Nginx
    sudo php-cgi -b 127.0.0.1:9000 -c /etc/php/7.0/cli/php.ini
    
  5. Visit http://localhost/reader/index.php.

Blog

linux-php-barcode-reader-'s People

Contributors

yushulx avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.