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 For New Implementations
  1. Make sure that you are running  with PHP 7.4 or later.
  2. Go to the master_2023 or master_2020, SimpleInvoices version.
  3. Click the “Clone or download” button and select the “Download Zip” option.
  4. Unzip to the file in the “document root” directory of your web-server.
  5. Create an empty “mySQL” database, assign a “username” and “password” to it.
  6. Make a “custom.config.ini” file by copying the “config.ini” file and edit the the following database settings:
    • databaseHost equals the name of your database server, normally “localhost“.
    • databaseDbname is the name of the database, normally “simple_invoices“.
    • databaseUsername 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.
    • databasePassword set to the password of the database user. Enclose the password in quotes.

How to set up your database:

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_2023” for PHP >= 8.1, “master_2020” for PHP >=7.4 & <8.x, “master_2019.2” for PHP >7.2 or 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. Extract the content of the zip file into your DOCUMENT ROOT directory. This will create the simpleinvoices-master directory containing the extracted files, Rename the new folder from the simpleinvoices_master to whatever you want your installation named.
  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 file. For master_2023 or master_2020, copy config.ini to make custom.config.ini. For master_2019.2 and master versions, copy config.php to make the custom.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 (Note settings shown are from master_2020):
    • databaseHost equals the name of your database server, normally “localhost“.
    • databaseDbname is the name of the database, normally “simple_invoices“.
    • databaseUsername 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.
    • databasePassword set to the password of the database user.

Note: Values for previous version’s custom.config.php are in the form of database.params.xxxx where xxxx is host, dbname, username or password.

  1. 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.
  2. 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.
  3. 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. 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. Ensure that PHP has GD2 and INTL support enabled. GD2 enables PHP to create and manipulate image files. INTL enables international features support in PHP. To verify that PHP has this 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. Next, scroll down to the “intl” section. If present, it is enabled. Note you need to change the $secure setting to false in the phpinfo.php file before running it. Also, set it back to true when done with it so no one can run it.
      • If GD2 and/or INTL support is not enabled, refer to your operating systems PHP guide on how to enable this.
        • On Lunix, install the php-gd and php-intl packages through “Add Applications” and uncomment the “;extension=php_gd.dll” and “;extension=php_intl.dll” lines in your PHP file. Restart the webserver after making that changes.
        • Using cPanel, run the “Select PHP Version” program and check the gd and intl options.
        • On Windows, uncomment  “;extension=gd2” and from the “;extension=intl” lines. Then restart the web-server.
      • Run phpinfo.php again to verify these features are enabled.
    3. 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 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.