Installing Smart Report Maker via cPanel

This post covers how to install Smart Report Maker via cPanel. Smart Report Maker provides an installer script to automate the installation across various environments, including Linux distributions like Ubuntu, Fedora, Debian, Red Hat, and CentOS, with support for both Apache and Nginx. However, since cPanel runs exclusively on Linux and primarily uses Apache, we will focus on installing it using Linux with Apache.

After purchasing and downloading the full version from our download area, navigate to the directory matching your server’s PHP version. There, you will find the following files and directories:

  • srm directory: Contains all the system files.
  • install.sh: A shell script to automate installation on Linux systems.
  • install.ps1: A PowerShell script for installation on Windows systems.
File structure within the directory corresponding to your server’s PHP version
  1. Compress the srm directory to reduce upload time.
  2. Log in to cPanel, navigate to File Manager under the Files section.
  3. Upload only the archived “srm” directory and the “install.sh” script via File Manager to your desired server location, which will be referred to as the installation directory in the following steps
Upload the files highlighted in the red rectangle

4- Once the upload is complete, extract the srm directory from the archived file in File Manager. Please ensure that the Smart Report Maker files and directories, such as “dashboard,” “modules,” and “srm_install,” are placed directly within the “srm” directory. Also, verify that both the “srm” directory and the install.sh script are at the same level.

The installation directory with both the “srm” folder and the “install.sh” script
The file structure within the “srm” directory

5- Provide 755 permission to both the srm directory and the install.sh installation script. Please Ensure that the install.sh script has execute permissions; otherwise, the installation process will encounter an error.

Assigning 755 permissions to the “srm” folder and the “install.sh” script

6-With Smart Report Maker, you need to assign a MySQL database for the system’s processes and permissions. This can be an existing database that you also plan to use for creating reports, charts, and dashboards, or a new MySQL database created specifically for this purpose. In either case, this database will serve as the default connection and will be required during the installation process. If you choose to create a new database, go to the MySQL Databases section under the Databases category in cPanel. Don’t forget to assign a MySQL user to the new database and grant the necessary permissions.

7- To execute the installation script, “install.sh,” you’ll need to enter commands on your remote server. You can do this using the Terminal available in cPanel under the Advanced section. However, if your hosting provider has disabled the online terminal, you will need to establish an SSH connection from your local computer. For guidance on setting up an SSH connection via cPanel, please refer to this post.

Locating the terminal in cPanel under the Advanced section

The online terminal in cPanel for executing commands directly on your server

8- After login to your terminal or ssh connection run the following commands:

  • Verify your current location by running:
ls -ahl
  • Move to the installation directory where you uploaded both the “srm” folder and the “install.sh” script by running the following command:
cd path_to_your_installation_directory
  • Confirm that both the “srm” folder and the “install.sh” script are present in the current directory and have the correct permissions by running:
ls -ahl
  • Once you run the installer, it will perform the following tasks:
    • Check if Git is installed. If Git is available, it will use it; otherwise, it will install Git and its dependencies.
    • Execute all necessary commands to install Smart Report Maker’s dependencies using Composer.
    • Create the necessary symbolic links (soft links).
    • Create a cron job for sending scheduled reports.
    • Adjust the directory permissions as required.
  • To run the installer, use this command
./install.sh

If you encounter ./install.sh: Permission denied, please run the following command:

sudo chmod +x install.sh && ./install.sh

  • If you are using Apache, The installer will complete all tasks mentioned in the previous points and display a success message with zero errors.
  • If both Nginx and Apache are detected on the server, the installer will prompt you to choose which web server to use, with cPanel please choose Apache.
  • Once the installer finishes and displays a success message with zero errors, delete the installer script by running the following command:
rm -f install.sh
  • If you’re unable to delete install.sh from the command line, you can use File Manager to remove it.

9- Finally, open your preferred web browser and go to:
https://your_domain_name/path-to-your-Installation-Directory/srm/dashboard/setup

Note: Use the following URL only if the URL in point 9 results in an error.
https://your_domain_name/path-to-your-Installation-Directory/srm/dashboard/public/index.php/setup

If this alternative works, please investigate why the redirection in the .htaccess file didn’t work, as it’s important for security reasons.

10- After successfully launching the web installer, click here to proceed with the installation.