Contents
To install PhpReport in your system, you will need the following software:
Run the following command with root privileges:
If you are installing PhpReport from sources instead of a release package, you must install composer to manage the project dependencies. Follow the official docs for the instructions: https://getcomposer.org/doc/00-intro.md#installation-linux-unix-macos
Connect to your database server as superuser, or a user with enough permissions to create databases and users.
Run the following command with root permissions:
su postgres -c psql
Once you have logged into PostgreSQL shell, run the following commands to create a database, a user and grant enough permissions (change the names and passwords if you feel like to, but remember it in the next steps):
CREATE DATABASE phpreport; CREATE USER phpreport WITH PASSWORD 'phpreport'; ALTER DATABASE phpreport OWNER TO phpreport;
Move the program files to a location available for the web server, inside a directory called phpreport. The usual default location for the Apache web server is: /var/www/html/
If you are installing PhpReport from sources instead of a release package, you must also run composer dump-autoload -o inside PhpReport root directory, so it can generate the autoload files. Then, run composer install to install the project dependencies.
You have two ways to do it: using the included web installation wizard or manually.
As a precondition, your web server has to have write permissions on the config directory of PhpReport to write the configuration file. Once that is done, open the url http://your-web-server/phpreport/install/index.php, and follow the on-screen instructions. If you didn't change the names and passwords specified in step 1, you won't need to modify the default values.
Follow these steps only if you haven't used the installation wizard. In first place, browse to the phpreport directory and create a configuration file with the default options with the command:
cp config/config.defaults config/config.php
If you changed any of data on the first step, edit the file config/config.php and set the correct values for the DB name, user, password, host, etc.
Browse to the directory sql/ and run the following commands (you will be asked by the password interactively, default is phpreport):
psql -h localhost -W -U phpreport phpreport < schema.sql psql -h localhost -W -U phpreport phpreport < uniqueConstraints.sql psql -h localhost -W -U phpreport phpreport < otherConstraints.sql psql -h localhost -W -U phpreport phpreport < initialData.sql psql -h localhost -W -U phpreport phpreport < update/all.sql
Set the correct DB name, user and host if they are different.
Use a browser to open the correct URL of your web server, and use the user name admin and the password admin for the first time. You will be able to create more users and change their passwords once you enter the application.
Once the installation is complete and you have checked it is working, remove the install/ and update/ directories inside your PhpReport, to prevent other users from resetting your DB.
You might have to modify some parameters in the file config/config.php to match your work domain. In particular, you might have to modify the default total number of holiday hours for a full-time worker. It is specified by the YEARLY_HOLIDAY_HOURS attribute, and you have to modify the following line to change it:
* @name YEARLY_HOLIDAY_HOURS * @global int holiday hours per year for an 8-hour working journey */ define ('YEARLY_HOLIDAY_HOURS', 184);
Remember to check the data model for holiday management to know how it works and which value you should put there.
This file is part of PhpReport 2.22-126-g762ba97a documentation. Generated on Wed 12 Jul 2023 05:04:53 PM UTC