Project

General

Profile

« Previous | Next » 

Revision ff2854d5

Added by Andreas Kohlbecker about 2 years ago

documentation on developement

View differences:

DEVELOPER.md
1
# Development of the EDIT Data Portal
2

  
3
*Mainly information on setting up the development environment for working with phpStorm.*
4

  
5
## Installing the drupal cdm_dataportal package
6

  
7
**NOTE**: Before starting with the installation, it is highly recommended that you read this chapter to the end. Since
8
the installation method for development environment differs in some details.
9

  
10
Follow the instructions in the [README.md](README.md) and make sure you are using the
11
Update - method 2](README.md##update---method-2), but respect the below recommended **2** deviations:
12

  
13
**1.**
14

  
15
For development you may want to choose different folder for installing the cdm-dataportal Drupal 7 project, 
16
than suggested in the [README.md](README.md). You could, for example, replace the commands given in the
17
[Download & extract](README.md#download--extract) chapter by:
18

  
19
~~~
20
mkdir -p ~/workspace
21
cd ~/workspace
22
wget https://cybertaxonomy.eu/download/dataportal/stable/drupal-7-cdm-dataportal-5.23.0.tar.gz
23
~~~
24

  
25
... and continue in the README.md at the corresponding position.
26
Now, you will of course need to replace all `cd /var/www` commands by `cd ~/workspace` !!!
27

  
28
**2.**
29

  
30
In the chapter [Apache2 configuration](README.md#apache2-configuration) you will need to change the 
31
`/etc/apache2/sites-available/` to adapt it to the different installation folder, and you also want to enable the
32
`AliasMatch` directive to be able to work with multiple sites in parallel:
33

  
34
Assuming your user-name is `andreas` and you have installed the cdm-dataportal Drupal 7 project in `/home/andreas/workspace/`
35
you will need to change three lines int the apache config file to. (Last line in no longer commented!).
36

  
37
~~~
38
DocumentRoot /home/andreas/workspace/drupal-7-cdm-dataportal/web
39
<Directory "/home/andreas/workspace/drupal-7-cdm-dataportal/web/">
40
AliasMatch ^/([^/]+)(.*)		/home/andreas/workspace/drupal-7-cdm-dataportal/web/$2
41
~~~~
42

  
43
Once you have completed the installation, you might have created a new dataportal site to start with, or you have cloned
44
a site according to the instructions in developer wiki page 
45
[On migrating Data Portal sites between servers](https://dev.e-taxonomy.eu/redmine/projects/edit/wiki/CdmDataportalSiteMigration)
46

  
47
In case you have **problems** to get your dataportal site running please read the hints in the 
48
[**troubleshooting**](https://dev.e-taxonomy.eu/redmine/projects/edit/wiki/CdmDataportalSiteMigration##Troubleshooting) 
49
section of above linked page.
50

  
51
## Install Xdebug
52

  
53
install Xdebug:
54

  
55
~~~
56
pecl install xdebug
57
~~~
58

  
59
at the end of the install-log, pecl shows something like:
60

  
61
~~~
62
Build process completed successfully
63
Installing '/usr/lib/php/20151012/xdebug.so'
64
install ok: channel://pecl.php.net/xdebug-2.6.0
65
configuration option "php_ini" is not set to php.ini location
66
You should add "zend_extension=/usr/lib/php/20151012/xdebug.so" to php.ini
67
~~~
68

  
69
add xdebug to the `php.ini`, e.g.: `/etc/php/7.4/apache2/php.ini` Use the `xdebug.so` installation location printed out 
70
in by pecl.
71

  
72
~~~
73
zend_extension=/usr/lib/php/20151012/xdebug.so
74
xdebug.idekey=PHPSTORM
75
xdebug.remote_enable=1
76
xdebug.remote_port=9008
77
~~~
78

  
79
Restart apache  to apply the settings 
80

  
81
~~~
82
systemctl restart apache2
83
~~~
84

  
85
## PhpStorm
86

  
87
Workspace setup
README.md
41 41

  
42 42
https://www.drupal.org/docs/develop/using-composer/managing-dependencies-for-a-custom-project
43 43

  
44

  
45

  
46 44
### Installation
47 45

  
48 46
**NOTE:** For detailed instructions which also cover the setup of apache and mysql please refer 
49 47
to: https://cybertaxonomy.eu/dataportal/installation
50 48

  
49
#### Requirements
50

  
51
* mysql (v5.x) or MariaDB (v10.0 to v10.3) server
52
* http server: apache or nginx; in this guide we will only cover the configuration of apache 2 (v 2.4)
53
* php 7, or php 5.6+ if php 7.x is not yet available for your system. php 8 will not work!
54

  
55

  
56
##### php
57

  
58
Install php 7.4 or 7.2 with the following extensions:
59

  
60
~~~
61
export PHP_VERSION=7.4 ; apt-get install php$PHP_VERSION php$PHP_VERSION-mysql php$PHP_VERSION-gd php$PHP_VERSION-json php$PHP_VERSION-curl php$PHP_VERSION-xml libapache2-mod-php$PHP_VERSION
62
~~~
63

  
64
For running the CDM Data Portal it is required to assign sufficient memory to php. 
65
Please open your `/etc/php/7.4/apache2/php.ini` and set the `memory_limit` parameter (memory_limit) to at least `128M`. 
66
The php.ini responsible for the php processes executed in apache is found in current Debian Linux and derivatives at
67
`/etc/php/7.4/apache2/php.ini` or `/etc/php/7.2/apache2/php.ini` .
68

  
69
~~~
70
;;;;;;;;;;;;;;;;;;;
71
; Resource Limits ;
72
;;;;;;;;;;;;;;;;;;;
73
memory_limit = 128M      ; Maximum amount of memory a script may consume (128MB)
74
~~~
75

  
76
##### Git
77

  
78
Git is needed for downloading (cloning) the  CDM Dataportal Drupal 7 installation package and to keep it up-to-date. 
79

  
80
~~~
81
sudo apt-get install git
82
~~~
83

  
51 84
#### Download & extract
52 85

  
53 86
Download the latest release from https://cybertaxonomy.eu/download/dataportal/stable/ to the location where you want 

Also available in: Unified diff