php-Inventory on CentOS

Found a simple PHP /MySQL solution for tracking Inventory parts to fit a need to track spare computer parts.

PHP Inventory is free, open-source, web-based inventory tracking solution, designed to provide small businesses the efficiency of large companies.

Inventory Control reduces costly inventory errors, improves customer service, and will increase the value of your business. PHP Inventory is easy to use and implement without the cost or complexity of larger inventory tracking systems.

Download the zip file from to your server and unzip to /var/www/html.

$ cp /var/www/html/
$ sudo unzip
$ sudo mv php-inventory/ inventory/

Php-inventory requires MySQL database to be setup. To keep with good practices we should setup an MySQL user and make that user the owner of the database.

Open a terminal and connect to the MySQL database. The passwords are made up and you should use your own.

$ mysql -u root -p
mysql> CREATE DATABASE `inventory` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
mysql> CREATE USER 'phpinv'@'localhost' IDENTIFIED BY 'phpMy1nv';
mysql> CREATE USER 'phpinv'@'%' IDENTIFIED BY 'phpMy1nv';
mysql> GRANT ALL ON `inventory` . * TO 'phpinv'@'localhost';
mysql> GRANT ALL ON `inventory` . * TO 'phpinv'@'%';
mysql> exit

Now that we have a database created and permissions set we need to run the supplied sql code. This is easiest to do this with phpMyAdmin or at the command line with MySQL. For ease of use I will be using phpMyAdmin.

Login to phpMyAdmin and click on the inventory database. Open site.sql with a text editor and select all , copy the text. Click on the SQL tab in phpMyAdmin and paste the contents in and click on the Go button. You should see a message stating your code executed successfully and on the left you will now see 7 new tables.Open site.xml and edit the database section with your database details.

<database type="mysql">

Change the title of the system edit line 8 of templatesadminlayout.htm between the <title> tags.

Open a browser and go to http://localhost/inventory/index.php and login with username of admin with a password of test, after login be sure to change the passwords for the admin and regular user.

Add this to your “.htaccess” file to prevent viewing of the xml config file.
</Files ~ ".xml">
Order allow,deny
Deny from all
Satisfy All

Note: They are currently working on a version 2 of the code and are looking for testers.

Comments are closed.