webapp_Pre-requisites.md 1.91 KB
Newer Older
Fabrice Gangler's avatar
Fabrice Gangler committed
1
# Prerequisites for  web application installation
2

Fabrice Gangler's avatar
Fabrice Gangler committed
3
## Prerequesites
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

- PHP >= **7.2.5**
- composer
- PHP extensions:
    - `ext-ctype`  `*`
    - `ext-curl`
    - `ext-iconv`  `*`
    - `ext-json`
    - `ext-PDO`   `*`
    - `ext-tokenizer`   `*`
    - `ext-xml`
    - `ext-zip`

`*`  installed by default with PHP via the `php-common` package (Ubuntu 18.04)

## Ubuntu 18.04

Fabrice Gangler's avatar
Fabrice Gangler committed
21
### 0. Verify prerequisites
22

Fabrice Gangler's avatar
Fabrice Gangler committed
23
#### PHP version
24
25
26
27
28
29
30
31
32
33
34
35
36
37

```bash
# List php versions available on the host:
sudo update-alternatives --list php

# Display the default php version:
sudo update-alternatives --display php
php -v

# If suitable PHP version is available, enable it:
sudo update-alternatives --set php /usr/bin/php7.2
php -v
```

Fabrice Gangler's avatar
Fabrice Gangler committed
38
#### Checks webapp prerequisites
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95

Checks that PHP and extensions versions match the platform requirements of the installed packages:

```bash
git clone git@gitlab.adullact.net:Comptoir/comptoir.git
cd comptoir/webapp/
composer check-platform-reqs
```

Documentation: https://getcomposer.org/doc/03-cli.md#check-platform-reqs


### 1. Install correct PHP version + extensions

```bash
sudo apt-get update
sudo apt install    \
    php7.2          \
    php7.0-curl     \
    php7.2-json     \
    php7.0-xml      \
    php7.0-zip
```

### 2. Install composer

```bash
sudo apt-get update
sudo apt install   composer
```

### 3. Enabled the PHP version needed by webapp

```bash
sudo update-alternatives --set php /usr/bin/php7.2
php -v
```

and verify again with:

```bash
composer check-platform-reqs
```

### Optional

Download `composer` packages in parallel:
- [hirak/prestissimo](https://packagist.org/packages/hirak/prestissimo), a composer plugin that downloads packages in parallel
- `hirak/prestissimo` must be installed globaled for the user who launch `composer install` command.

```bash
composer global require hirak/prestissimo

    # hirak/prestissimo requires ext-curl
    php -v
    sudo apt -y install php<Major.Minor>-curl
```