Using the PHP code: prerequisites and installation¶
You need to install some stuff on your server in addition to all prerequisites for LARA local installation. Everything is free.
If you don’t already have PHP installed, install it now.
You will need PHP packages for
php7.2-curl or similar) and
php7.2-mbstring or similar), which probably won’t be installed by default.
XAMPP or Wamp¶
Download and install MySQL Workbench. It’s not essential. You can easily use phpMyAdmin. It just makes the SQL part of work easier for you.
Create `LARA-portal` database on your server and then, create all LARA tables by importing the exportLaraPortalDB.sql in your schema. If you are using phpMyAdmin, you can easily upload this file in the import tab.
For working with LARA, you need to have three separate directories:
Code root directory¶
In this directory, you copy the LARA code from sourceforge.
Let’s call it
/codeRoot/LARA-portal. Based on this assumption, the
ROOT constant in config file will be defined as
PythonDir constant as
/codeRoot/LARA-portal/trunk/Code/Python/ and the
LaraEnv contant as
Data root directory¶
This directory is the main repository to store the results of different python calls. If, assumptively, we call it
dataRoot, the LaraContentDir constant value should be the same. Some predefined directories should be located in the data root. We mention these directories and their related constant variable below:
Web root directory¶
For external access to the LARA format contents, a directory inside the web site repository should be defined so that people can have access to the HTML files of texts and words. In our server, it’s called callector. Based on this directory on your own server, please redefine
CallectorDir, and the
WebRoot constant in the config file. Two predefined directories here are:
What to change in the config file?¶
Here, we explain the config file in more detail so that you can change it in the appropriate way.
PythonCmnd are the three constant that we use to run the Python commands via shell_exec. The first one refers to the direction you’ve installed Lara codes, the second one is the directory of TreeTagger, and the latest indicates the version of Python which will run these commands.
LaraDB constant array contains the database connection information and
LataLDT constant array contains the LiteDevTools connection information.
In the following lines, we define all constants which are used for the Lara structure part. You probably will change them according to your repository settings.
ROOT: PHP codes directory.
PythonDir: Python codes directory.
LaraContentDir: Data root directory.
CallectorDir: Web root directory.
PortalReadingHistoryDir: Reading histories storage directory.
WebRoot: Root of web address for LARA contents.
How to run?¶
Similar to (almost) all PHP projects, you can run the LARA portal with opening index.php file in view folder after copying the whole project in www folder.
If things go wrong, it is often useful to consult the relevant Apache error log. On the Unige server, this can be found at
Please feel free to contact us if you have any questions setting up the LARA portal.