Documentation

1. Overview

This Documentation describes the installation and configuration steps of phpAnalytics.

While the installation process is rather simple, some of the instructions presented here will require minimum understanding in working with databases and managing files on a server.

If you're not familiar with the procedures presented, we do offer installation Services for an additional fee.


2. Requirements

Please ensure that your server meets the following minimum requirements:

Software Modules
PHP 7.2.5+ BCMath, Ctype, Fileinfo, JSON, Mbstring, OpenSSL, PDO, Tokenizer, XML, GD, cURL
Apache 2+ mod_rewrite
MySQL 5.7.7+
MariaDB 10.3.17

3. Installation

3.1. Creating and configuring the database

If you already have an empty database, a database username and password, you can skip the next steps.

  1. Create a new MySQL database.
  2. Create a new MySQL username and password.
  3. Assign full privileges to your database username.
Useful resources
3.2. Uploading the files
On some operating systems, the dotfiles are hidden by default. Before starting to upload the files, please make sure your file explorer has the option to view hidden files turned on.

Upload what's inside the Script folder on the web root folder of your domain. This folder is generally called public_html, html, or example.com, but depending on your server's configuration, it might be named differently.

Useful resources
3.3. Configuring the files

Set the access permissions (CHMOD) to 775 to the following files and folders:

Files
  • .env
Folders
  • bootstrap/cache
  • public/uploads/brand
  • resources/lang
  • storage
  • storage/framework/
  • storage/framework/cache
  • storage/framework/cache/data
  • storage/framework/sessions
  • storage/framework/views
  • storage/logs
Useful resources
3.4. Changing the public directory Important

Configure your web server's document / web root to point to the public directory of the software. For example, if you've uploaded the software in example.com folder, your web directory should be changed to example.com/public folder.

Useful resources
3.5. Finishing the installation
  1. Go to https://example.com/install and follow the installation wizard.
  2. Once you've installed the software, login into your account, and go to https://example.com/admin.
  3. You'll be asked to activate your License Key. See how to retrieve your license key.
3.6. Setting up the cron jobs

The software requires cron jobs to be set up in order to automate some of its functions, such as sending out periodic emails, checking the status of the accounts, as well as additional database clean-ups.

  1. Go to Admin Settings Cron jobs.
  2. Copy the cache command and set up a weekly cron job for it.
  3. Copy the check command and set up a daily cron job for it.
  4. Copy the clean command and set up a daily cron job for it.
  5. Copy the email command and set up a monthly cron job for it.
Useful resources

4. Configuration

Most of the software's settings are pretty straight forward and self explanatory, but some of them require more advanced steps to get them working, which are covered in this chapter.

4.1. Payment processors

To enable any of the payment processors, an Extended license is required. The payment processors can be enabled from Admin Settings Payment processors.

4.1.1. Stripe
  1. Login into your Stripe account.
  2. From the sidebar, go to the Developers section of the Stripe dashboard and click on API Keys.
  3. Copy the Publishable key and Secret key in Admin Settings Payment processors Stripe.
  1. From the sidebar, go to the Developers section of the Stripe dashboard and click on Webhooks.
  2. Click on Add a new endpoint.
  3. On the Endpoint URL field paste your webhook URL, this can be found on Admin Settings Payment processors Stripe.
  4. On the Version field, select the latest version.
  5. On the Events to send field, click on receive all events, and click the Add endpoint button.
  6. Copy the Signing secret in Admin Settings Payment processor Stripe.
4.1.2. PayPal
  1. Login into your PayPal account.
  2. Go to the My apps & credentials section, click on Live button and then on the Create app button.
  3. Copy the Client ID and Secret in Admin Settings Payment processors PayPal.
  1. Go to the My apps & credentials section, click on Live button and then select your app.
  2. Scroll down to LIVE WEBHOOKS and click on the Add webhook button.
  3. On the Webhook URL field paste your webhook URL. This can be found on Admin Settings Payment processors PayPal.
  4. Under the Events types select All events and save your changes.
  1. Go to the My apps & credentials section, click on Live button and then select your app.
  2. Copy the Webhook ID in Admin Settings Payment processors PayPal.
4.1.3. Coinbase
  1. Login into your Coinbase account.
  2. From the sidebar, go to the Settings section of the Coinbase dashboard and scroll down to API keys.
  3. Create an API key, and copy the key in Admin Settings Payment processors Coinbase.
  1. From the sidebar, go to the Settings section of the Coinbase dashboard and scroll down to Webhook subscriptions.
  2. Click on Add an endpoint.
  3. On the Endpoint URL field paste your webhook URL. This can be found on Admin Settings Payment processors Coinbase.
  1. From the sidebar, go to the Settings section of the Coinbase dashboard and scroll down to Webhook subscriptions.
  2. Click on Show shared secret.
  3. Copy the Webhook shared secret in Admin Settings Payment processors Coinbase.
4.1.4. Bank
  • All fields are optional.
4.2. Plans

Plans can be managed from Admin Business Plans1.

  • The Tax rates field allows you to select multiple tax rates. See: Tax rates for additional information.
  • The Coupons field allows you to select multiple coupons. See: Coupons for additional information.
  • When the Visibility field of a plan is set to Unlisted, the plan will not be listed on the website, but will continue to be accessible by anyone that knows the URL.
  • Plan features that accept a number can be limited as follows: -1 for unlimited, 0 for none, and N for a specific number.
  1. By default, the software comes with a free plan, which is the default plan on all accounts. The default plan cannot be deleted, however its features can be limited.
4.3. Tax rates

Tax rates can be managed from Admin Business Tax Rates.

4.4. Coupons

Coupons can be managed from Admin Business Coupons.

4.5. Emails
  1. Go to Admin Settings Email.
  2. Change the Driver field value to SMTP.
  3. Fill in the rest of the fields with your SMTP credentials.
4.6. Captcha

The Captcha system relies on Google reCAPTCHA's API.

  1. Login into your Google reCAPTCHA account.
  2. Create a new reCAPTCHA v2 Invisible Badge.
  3. Fill all the other fields with the requested information.
  4. Copy the Site key and the Secret key in Admin Settings Captcha.

5. Update

Important notice for v2.5.0
This new version brings significant new features and changes, mainly to the payment system, which was extended from Stripe, to include PayPal, Coinbase and Bank payments, which has a few downsides, as following:
1. Subscriptions
All current subscriptions will be lost. You will have to manually cancel each subscription from your Stripe dashboard, and manually assign the rest of the subscription duration for each user via Admin Users Edit Plan. Users who wish to be on a recurring plan will have to subscribe again.
2. Cronjobs
The cron jobs need to be set again, as their URL path have changed. See: Setting up the cron jobs for additional information.
3. Stripe webhook
The stripe webhook needs to be set again, as the webhook path has changed. See: Configuring Stripe for additional information.
Before making an update, always remember to do a complete backup of your website.
If you've made any modifications to the software's files, your changes will be lost.
  1. Make a backup of the .env config file located on your server.
  2. Upload and replace all the files on your server with what's inside the Script folder.
  3. Restore your .env config file on your server.
  4. Go to https://example.com/update and follow the update wizard.1
  1. Updates that do not have database changes, will not show up in the update wizard.

6. FAQ

  • I have a support inquiry, a question or a problem, how can I contact you?
    You can contact us here.
  • What hosting do you recommend?
    We recommend using DigitalOcean, as they offer great performance and flexibility at an affordable price.
  • Is installation included in the price?
    No, installation is not included. We offer installation services for an extra fee, please consult the Services section for more details.
  • My website returns a Not Found message, why?
    Please ensure that you have mod_rewrite enabled on your server.
  • How can I translate my website?
    Make a copy of the default en.json language file found in /resources/lang folder, and change it according to your needs.
  • My website returns a blank page, why?
    This generally happens when one of the server requirements is not met, please ensure your server meets the software's requirements.