Installation Instructions

If you know what your doing re PHP/MySQL, just follow the Quick Install Guide. Otherwise follow the Full Details instructions below.

 

Quick Install Guide
  1. Go to “master_2019.2” for PHP 7.2 and greater, or “master” for PHP 5.6, 7.0 or 7.1 SimpleInvoices version.
  2. Click the “Clone or download” button and select the “Download Zip” option.
  3. Unzip to the file in the “document root” directory of your web-server.
  4. Create an empty “mySQL” database, assign a “username” and “password” to it.
  5. Make a “custom.config.php” file by copying the “config.php” file and edit the the following database settings:
    • database.params.host equals the name of your database server, normally “localhost“.
    • database.params.dbname is the name of the database, normally “simple_invoices“.
    • database.params.username set to the database username. The default is “root” but you should set up a specific user and remove root access to secure the database.
    • database.params.password set to the password of the database user.

Full Details
  1. Make sure the Requirements have been met with necessary software installed and running.
  2. Download the latest Fearless359, SimpleInvoices zip file from “master_2019.2or for PHP 5.6x users, “master” SimpleInvoices version.
  3. Extract the content of the zip file into your Downloads directory. This will create the simpleinvoices-master directory containing the extracted files.
  4. Create a directory in the web-server DOCUMENT ROOT directory, i.e. on Debian the /var/www directory, or on Windows using xampp the “c:\xampp\htdocs” directory, or using wampserver the “c:\wamp\www” directory.
  5. Copy the extracted folders and files from the simpleinvoices_master directory to the directory created in the previous step.
  6. Create a database such as, simple_invoices, on your database server. If using cPanel, use the Database Wizard, for Windows using xampp or wampserver, use phpMyAdmin. Various utilities exist on Linux systems but you can install and use phpMyAdmin there also. Using the same tool, create a username and password for the database. You should disable or password protect the root user assigned to the database by default.
  7. In the config directory, make a custom.config.php file by copying the config.php file. This is done to protect your settings from being loaded over when future updates are installed.
  8. Edit the the following database settings:
    • database.params.host equals the name of your database server, normally “localhost“.
    • database.params.dbname is the name of the database, normally “simple_invoices“.
    • database.params.username set to the database username. The default is “root” but you should set up a specific user and remove root access to secure the database.
    • database.params.password set to the password of the database user.
  9. Set the tmp directory as writable. On Linux systems, cd to the Simple Invoices directory, “cd /var/www/html/simpleinvoices“, and chown the cache directory to the Apache web-server user, “chown apache:apache cache“, or if your lazy just chmod 777 the directory, “chmod -Rv 777 tmp“. On Windows, just make sure the directory is writable.
  10. In your web browser, access Simple Invoices, http://localhost/simpleinvoices, and follow the 3-step installer instructions. Note that simpleinvoices used in the example URL assumes that is the name of the SI directory you created in your DOCUMENT ROOT directory. For your live installation, do not install the sample data. Instead, via the SI Dashboard menu, select each one of the record set up options to prepare for processing live invoices.
  11. If you want to require users to login Simple Invoices, follow the instructions in the How To Enable Authentication.

 

Export to PDF Setup

Try to export an invoice to a PDF file. If it works, the you do not need to make any changes. If it doesn’t work, make the following changes:

  • For ‘Export to PDF’ to work, there are two modifications that need to be made to your system:
    1. The first step is to ensure the PDF exports directory writable by the web-server.
      • Make the cache directory in your Simple Invoices path must be writable.
        • In Linux, cd to the Simple Invoices “tmp” directory, cd /var/www/html/simpleinvoices/tmp, and chown the cache directory to the Apache web-server user, chown apache:apache cache.
        • In Windows, browse to the cache directory and make sure its writable by all users.
      • Next make the Simple Invoices PDF fonts directory writable.
        • In Linux, chown the ./library/pdf/fpdf directory to the Apache web-server user, chown apache:apache library/pdf/fpdf/.
        • In Windows, browse to the library/pdf/fdpf directory and make sure its writable by all users.
    2. The second step is to ensure that PHP has GD2 support enabled. This enables PHP to create and manipulate image files. To verify that PHP has GD2 support enabled, do the following:
      • Open your internet browser and run the Simple Invoice phpinfo.php file, http://localhost/simpleinvoices/phpinfo.php. Scroll down to the “gd” section and check that “GD Support” section is enabled, and the “GD Version” set to a 2.x or greater version.
      • If GD2 support is not enabled, refer to your operating systems PHP guide on how to enable this.
        • In Lunix, just install the php-gd package through “Add Applications“.
        • Using cPanel, run the “Select PHP Version” program and check the gd option.
        • On Windows, remove the comment character (“;“) from the beginning of the “extension=gd2 line and restart the web-server.
    3. The third step is to test if PDF creation needs to be enabled in the php.ini file. To do this:
      • Open the http://localhost/simpleinvoices/library/pdf page in your browser and display the html2ps/pdf demo page. This page tests your system to see if it is capable of generating PDF files. On this page:
        • Check the Single URL setting of the Source area. By default, it is set to www.google.com. If you are connected to the internet just leave this as is. If you are not connected to the internet, change this to a valid web page on your system such as http://localhost/simpleinvoices.
        • Next click the Convert File button at the bottom of the page. If PDF file settings are correct, a PDF of the referenced page will be created. If the PDF is not created verify that the previous changes have been correctly made and the web-server has been restarted. Also check to see if the following error occurs:
          Fatal error: Allowed memory size of 8388608 bytes exhausted, tried to allocate 4864 bytes, in /var/www/simpleinvoices/pdf/filter.data.html2xhtml.class.php on line 8

          If this error occurs, you need to edit your php.ini file to increate the memory limit setting. To do this, do the following:

          1. Find your php.ini file by accessing the phpinfo.php page, http://localhost/simpleinvoices/phpinfo.php, and note the path the Loaded Configuration File refers to.
          2. Open the php.ini file in a text editor and alter the “memory_limit” number; setting it to at least 64M.
            ;;;;;;;;;;;;;;;;;;;
            ; Resource Limits ;
            ;;;;;;;;;;;;;;;;;;;
            max_execution_time = 90 ; Maximum execution time of each script, in seconds
            max_input_time = 60 ; Maximum amount of time each script may spend parsing request data
            memory_limit = 8M ; Maximum amount of memory a script may consume, 8MB

            Your altered php.ini file should now looking like:

            ;;;;;;;;;;;;;;;;;;;
            ; Resource Limits ;
            ;;;;;;;;;;;;;;;;;;;
            max_execution_time = 90 ; Maximum execution time of each script, in seconds
            max_input_time = 60 ; Maximum amount of time each script may spend parsing request data
            memory_limit = 64M ; Maximum amount of memory a script may consume, 8MB
          3. Restart your Apache web-server for the change to take effect and run the test again.
Final Steps

At this point, everything has been configured and tested. Now Simple Invoices is ready to be used. Open your internet browser and access the http://localhost/simpleinvoices page and begin using Simple Invoices.

 

Problems with the Simple Invoices installer?

If you had problems with the Simple Invoices installer you can manually import the Simple Invoices database structure by following these steps:

  1. Open phpMyAdmin (or the tool you use to maintain the MySQL database,
  2. Select the Simple Invoices database,
  3. Select the “Import” tab and choose the file, “databases/mysql/simpleinvoices_full.sql” from your Simple Invoices directory.