FAQ

If you are seeing the message system folder missing, then you have cloned the source using git and you need to run a build first. Check INSTALL.md for instructions or download latest zip file from bintray instead.

Accordion SamIf at login time you read “The installation is not correct, check your php.ini file.”, please check the error_log in public folder to understand what’s wrong and make sure you read the INSTALL.md. To know how to enable error_log, please read the comment in issue 1770.ple Description

If you installed your OSPOS under a web server subdir, please edit public/.htaccess and go to the lines with comment if in web root and if in subdir comment above line, uncomment below one and replace with your path and follow the instruction on the second comment line. If you face more issues please read issue #920 for more help.

Apache server configurations are SysAdmin issues and not strictly related to OSPOS. Please make sure you first can show a “hello world” html page before pointing to OSPOS public directory. Make sure .htaccess is correctly configured.

If the avatar pictures are not shown in Items or at Item save time you get an error, please make sure your public and subdirs are assigned to the correct owner and the access permission is set to 755.

If you install ospos in docker behind a proxy that performs ssloffloading, you can enable the url generated to be https instead of http, by activating the environment variable FORCE_HTTPS = 1.

If you have suhosin installed and face an issue with CSRF, please make sure you read issue #1492.

  1. Download and Install Wamp or Xampp
  2. Download and Install composer, node.js, grunt-cli
  3. Download the "opensourcepos-master.zip" (~3mb) and extract it to www or htdocs directory
  4. Open command prompt in "opensourcepos-master" directory and run the following commands.
    • composer install
    • npm install
    • grunt --force
  5. Create/locate a new mysql database to install open source point of sale into
  6. Execute the file database/database.sql to create the tables needed
  7. Modify application/config/database.php and modify credentials if needed to connect to your database
  8. Go to your point of sale install public dir via the browser LOGIN using username: admin password: pointofsale

Default Linux, Nginx, MariaDB, PHP7.0 & Adminer stack on Ubuntu 16.04

1: Update Ubuntu 16.04 LTS

sudo apt-get update

sudo apt-get upgrade

2: Install Nginx Web Server

sudo apt-get install nginx

After installation, enable Nginx to auto start when Ubuntu is booted

sudo systemctl enable nginx

Start Nginx with this command

sudo systemctl start nginx

Check out it's status

systemctl status nginx

Now in your browser’s address bar, type http://localhost or http://127.0.0.1 and hit enter

You will see "Welcome to nginx!, that means nginx installed and running successfully.

Now, we need to make www-data (Nginx user) as the owner of web root directory

sudo chown www-data /var/www/html -R

3: Install MariaDB

sudo apt-get install mariadb-server mariadb-client

MariaDB server should be automatically started. Use systemctl to check its status.

systemctl status mysql

Enable MariaDB to automatically start when Ubuntu is rebooted

sudo systemctl enable mysql

Run the post installation security script

sudo mysql_secure_installation

When it asks you to enter MariaDB root password, press enter because you have not set the root password yet. Then enter y to set the root password for MariaDB server.

Next just press Enter to answer all the remaining questions. This will remove anonymous user, disable remote root login and remove test database. This step is a basic requirement for MariaDB database security.

4: Install PHP7

sudo apt-get install php7.0-fpm php7.0-mbstring php7.0-xml php7.0-mysql php7.0-common php7.0-gd php7.0-json php7.0-cli php7.0-curl php7.0-intl php7.0-bcmath php7.0-mcrypt

Now start php7.0-fpm

sudo systemctl start php7.0-fpm

Check php7 status

systemctl status php7.0-fpm

5: Create a Default Nginx Server Block File

Remove the "default.conf" symlink in "sites-enabled" directory

sudo rm /etc/nginx/sites-enabled/default

create a new default server block file under /etc/nginx/conf.d/ directory

sudo nano /etc/nginx/conf.d/default.conf

Paste the following text into the file, save and close the file

server {
	server_name localhost;
	root /var/www/html/;
	index index.php index.html index.htm;

	location / {
		try_files $uri $uri/ /index.php;
	}

	location /opensourcepos {
		try_files $uri $uri/ /opensourcepos/public/index.php;
	}

	location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ {
		expires  15d;
	}

	location ~ \.php$ {
		include /etc/nginx/fastcgi_params;
		fastcgi_index  index.php;
		fastcgi_param  SCRIPT_FILENAME  /var/www/html/$fastcgi_script_name;
		fastcgi_param  REQUEST_URI      $request_uri;
		fastcgi_param  QUERY_STRING     $query_string;
		fastcgi_param  REQUEST_METHOD   $request_method;
		fastcgi_param  CONTENT_TYPE     $content_type;
		fastcgi_param  CONTENT_LENGTH   $content_length;
		fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
	}
}

Test nginx configuration and reload it

sudo nginx -t

sudo service nginx restart

6: Test PHP

php --version

Test PHP-FPM, first create a php_info.php file in the Web root directory

sudo nano /var/www/html/php_info.php

Paste the following PHP code into the file and save it

<?php phpinfo(); ?>

Now in the browser address bar, enter localhost/php_info.php. You should see your server’s PHP information. This means PHP is workinging fine. For your server’s security, you should delete php_info.php file now.

7: Install 'Adminer' ('phpmyadmin' equivalent)

Adminer is a free opensource data base management tool like phpmyadmin. It is very ightweight and easy to install and also supports various themes. Download Adminer from here:

https://github.com/vrana/adminer/releases/download/v4.2.5/adminer-4.2.5.php

Place it in var/www/html folder. To access it, type in your browser localhost/adminer-4.2.5.php

8: Fix MariaDB bug in ubuntu 16.04

Your Linux OS has a root user. MariaDB also has a root user. So sometimes, when you try to log into MariaDB monitor as root user, MariaDB may authenticate you via the Unix_Socket plugin but this plugin is not installed by default. So you see Plugin 'unix_socket' is not loaded Error.

Fix this error

First stop MariaDB, use this command to stop it.

sudo systemctl stop mysql

Then start MariaDB with --skip-grant-tables option which bypass user authentication

sudo mysqld_safe --skip-grant-tables &

Log into MariaDB monitor as root

mysql -u root

Enter the following SQL statement to check which authentication plugin is used for root

MariaDB [(none)]> select Host,User,plugin from mysql.user where User='root';

You will see it’s using unix_socket plugin. To change it to mysql_native_password plugin, execute this command:

MariaDB [(none)]> update mysql.user set plugin='mysql_native_password';

Exit MariaDB monitor

flush privileges; quit;

Stop mysqld_safe

sudo kill -9 $(pgrep mysql)

Start MariaDB again

sudo systemctl start mysql

Now you can use normal password to login

mysql -u root -p

That's all, you have done everything. Enjoy !

Local Deployment using MAMP for Windows

Download and Install MAMP then go to C:\MAMP\htdocs and place the extracted folder of masterpos there. Now go to localhost/MAMP and then go to phpMyAdmin and create a database with any name and create a user with all privileges for the created Database. Now import the database.sql file from your database folder of your pos directory and click Go. Database is created. Now go to config folder and change database.php.tmpl to database.php and set the database name, username and password for the database you created through phpMyAdmin.

Go to your browser and write localhost and select your project from the list. OSPOS will be loaded. Give the the username and password which is "admin" and "pointofsale" respectively.

ISSUES

Go to Sales Module and if your UI is blocked then you have to do some extra work. Run your MAMP application which is most probably already running. Click on "Preferences", now go to php tab and check which php version is loaded in your MAMP by clicking on dropdown list. Select a php version with 5.6.** (e.g. 5.6.13 or 5.6.24).

if none of 5.6.** version is available in the list then follow the instruction below Goto C:\MAMP\bin\php and rename all the non-required php folder to some other name. (e.g. rename php5.4.1 to x_php5.4.1). only 2 folders from here will show in your php dropdown at MAMP.

Now go to C:\MAMP\bin\php\php5.6.24\ and copy all the icu**53.dll files from here and paste them to C:\MAMP\bin\apache\bin.

Now go to C:\MAMP\conf\php5.6.24 and open php.ini file and find ;extension=php_intl.dll and remove the semicolon in the start and make sure bcmath is not commented out as well. If it doesn't work please read issue 1607 for a detailed list of extensions.

Restart your MAMP and run the ospos again. It should work now. Enjoy. 🙂

If you are using WAMP follow the MAMP setup for the icu files.

Currently Php 7 is working. Download and Install Xampps currrent version for 3.1.0 or an earlier version of Xampp for 3.0.2. OSPOS is working great on Windows 10.https://www.apachefriends.org/download.html Launch the Control Panel. Start Apache and Mysql. From Apache select Config. Edit the Php.ini file to uncomment the following extensions as needed. The extensions are about halfway down. bcmath already appears to be enabled in this version of Xampp.

extension=php_gd2.dll, This may already be enabled.

extension=php_intl.dll, Was not enabled.

extension=php_sockets.dll. Was not enabled.

NOTE: If it doesn't work please read issue 1607 for a detailed list of extensions.

Now Apache should be ready to go.

Download and extract either Stable or Unstable from the Readme page.

If you are using Windows right click on the downloaded zip file.

Select properties and Select the Unblock button if it is there. Then extract the file.

Place the extracted file into the htdocs directory.

In Xampp Control Panel go to Mysql - Admin. Create a new database. Name it ospos or whatever you want. Now select the database and go to import. Select browse and go to the opensourcepos directory and locate the database directory. Select database.sql for the import if this is a new install. Select 2.4_3.0.sql for the import if this is an updated install. After the database has completed installing go back to the ospos dir and go to ospos/application/config. Rename database.php.tmpl to database.php. Open database.php and change the following lines as needed.
'username' => '', default name is root for mysql.
'password' => '', default no password for mysql or change if you created a mysql password.
'database' => '', change this to your new database name.
Edit and save.

Restart the Apache server after you have made any changes.

Now you should be able to go to localhost/what ever name you chose to use/public and see the login screen.

In 3.1.0 or higher if you have not enabled all the necessary extensions it will give you a warning on the Login screen.

Default user - admin
Default password - pointofsale.
Play around and get familiar with OSPOS.

Default Linux, Nginx, MariaDB, PHP7.0 & Adminer stack on Raspbian Jessie.

1. Add New Source Repository

By default Raspbian Jessie comes with PHP5.6, so you have to add a new repo to use php7. You can use php5.6 but php7 performs far better.

Type the following code in your terminal:

sudo nano /etc/apt/sources.list

Add this line to the list:

deb http://mirrordirector.raspbian.org/raspbian/ stretch main contrib non-free rpi

Save the file by pressing Ctrl+x, y, Enter.

2. Update Raspbian Jessie

sudo apt-get update

sudo apt-get upgrade

3. Install Nginx Web Server

sudo apt-get install nginx

sudo systemctl enable nginx

sudo systemctl start nginx

systemctl status nginx

Now in your browser’s address bar, type http://localhost or http://127.0.0.1 and hit enter

You will see "Welcome to nginx!, that means nginx installed and running successfully.

Now, we need to make www-data (Nginx user) as the owner of web root directory

sudo chown www-data /var/www/html -R

4. Install MariaDB

sudo apt-get install mariadb-server mariadb-client

MariaDB will ask you to set root user's password, provide it and confirm it.

sudo systemctl enable mysql

5. Install PHP7

sudo apt-get install php7.0-fpm php7.0-mbstring php7.0-mysql php7.0-common php7.0-gd php7.0-cli php7.0-curl php7.0-intl php7.0-bcmath php7.0-mcrypt

sudo systemctl start php7.0-fpm

systemctl status php7.0-fpm

6. Create a Default Nginx Server Block File

Remove the "default.conf" symlink in "sites-enabled" directory

sudo rm /etc/nginx/sites-enabled/default

create a new default server block file under /etc/nginx/conf.d/ directory

sudo nano /etc/nginx/conf.d/default.conf

Paste the following text into the file, save and close the file

server {
		server_name localhost;
		root /var/www/html/;
		index index.php index.html index.htm;

		location / {
			try_files $uri $uri/ /index.php;
		}
    
		location /opensourcepos {
			try_files $uri $uri/ /opensourcepos/public/index.php;
		}
	
		location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ {
			expires  15d;
		}

		location ~ \.php$ {
			include /etc/nginx/fastcgi_params;
			fastcgi_index  index.php;
			fastcgi_param  SCRIPT_FILENAME  /var/www/html/$fastcgi_script_name;
			fastcgi_param  REQUEST_URI      $request_uri;
			fastcgi_param  QUERY_STRING     $query_string;
			fastcgi_param  REQUEST_METHOD   $request_method;
			fastcgi_param  CONTENT_TYPE     $content_type;
			fastcgi_param  CONTENT_LENGTH   $content_length;
			fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
		}
	}

Test nginx configuration and reload it

sudo nginx -t

sudo service nginx restart

7. Test PHP

php --version

Test PHP-FPM, create a php_info.php file in the Web root directory

sudo nano /var/www/html/php_info.php

Paste the following code to the file:

<?php phpinfo(); ?>

Now in the browser address bar, enter localhost/php_info.php. You should see your server’s PHP information. This means PHP is workinging fine. For your server’s security, you should delete php_info.php file now.

8. Install 'Adminer'

Download Adminer from this page:

https://www.adminer.org/

Place it in var/www/html folder. To access it, type in your browser localhost/adminer-x.x.x.php

NOTE: x.x.x stands for Adminer version, you have downloaded.

9. Deploy OSPOS

Now download, extract and place opensourcepos to var/www/html. Don't forget to rename it as opensourcepos. Create a new Database using Adminer. Rename your Application/config/database.php.tmpl to database.php. Provide database connection credentials by editing the database.php file. Type in your browser http://localhost/opensourcepos/public.

ENJOY!

If you have any issue, please post in the Issues section.

Installation of Basic Components

Login to your pi pi ssh using Putty. First update all the packages.

sudo apt-get update & sudo apt-get upgrade

Become root sudo su

Then install Apache, PHP, MySQL in and phpMyAdmin order to be able to run OSPOS.

sudo apt-get install apache2 php5 libapache2-mod-php5 mysql-server php-pear php5-mysql phpmyadmin apache2-utils php5-gd php5-intl -y

Add the user name and password for MySQL and phpMyAdmin.

Configuration

Configure Date and Time according to your location for the server to run correctly.

  1. sudo dpkg-reconfigure tzdata Select your time Zone Modify the PHP files for the Time zone.
  2. goto nano /etc/php5/cli/php.ini and find "Date" by scrolling down or by Ctrl+W and remove ; from the line and modify like this date.timezone = Asia/Kolkata.
  3. goto nano /etc/php5/apache2/php.ini and find "Date" by scrolling down or by Ctrl+W and remove ; from the line and modify like this date.timezone = Asia/Kolkata.
  4. Modify Apache 2 for the PHPMYADMIN. goto nano /etc/apache2/apache2.conf and Add the next code to the bottom of the line Include /etc/phpmyadmin/apache.conf.
  5. restart Apache and check if it's working correctly /etc/init.d/apache2 restart.

Installing And Configuring OSPOS (must be root)

  1. Download OSPOS git clone https://github.com/jekkos/opensourcepos.
  2. Rename PHP file cp -r opensourcepos/application/config/database.php.tmpl opensourcepos/application/config/database.php.
    3.Modify application/config/database.php to connect to your database.
    nano opensourcepos/application/config/database.php.
    go to the bottom of the file and modify this to your database

$db['default'] = array( 'dsn' => '', 'hostname' => 'localhost', 'username' => 'root', 'password' => '12345678', 'database' => 'opensourcepos',

  1. Copy This Files to apache.
    cp -r opensourcepos /var/www/html
  2. Change the permissions
    chmod -Rv 755 cache* /var/www/html/opensourcepos.
  3. Restart Apache
    /etc/init.d/apache2 restart.

Configuring OSPOS ( Network Install )

Please do not use a Web Browser with a lot of addons as it can create problems with OSPOS. Install Firefox if you are using Chrome with a lot of addons.

  1. Download the Source form https://github.com/jekkos/opensourcepos.
  2. Go to your PI's ip address e.g http://192.168.3.116/phpmyadmin.
  3. Create a database name as above saved in configuration file.
  4. As it's a local installation, to improve performance set in application/config/config.php$config['ospos_xss_clean'] = FALSE; - Please note that this will disable the Cross Site Scripting protection, but assuming it's a standalone installation you should not suffer this issue but please consider carefully this point before proceeding -
  5. Select that Database and Click import and select the database file from previously downloaded file.
  6. After successfully importing the database login to OSPOS.
  7. Restart apache /etc/init.d/apache2 restart
  8. Go to your PI's ip address e.g http://192.168.3.116/opensourcepos.
  9. Enjoy!!!.

Alternatives

Although Apache and MySQL are popular choices, on Raspberry PI alternatives could be considered like Nginx + PHP-FPM + MariaDB on Arch Linux. Here how to.

Sme background article that explains how to install a LEMP stack, and another one here. If you succeed in this alternative installation please let us know the full instructions that we update this wiki page.

See this wiki page for an installation guide on Ubuntu 16.04.