README.md 10.8 KB
Newer Older
Diego Hernandes's avatar
Diego Hernandes committed
1
# PHP Repositories for Alpine - by CODECASTS
Diego Hernandes's avatar
Diego Hernandes committed
2

Diego Hernandes's avatar
Diego Hernandes committed
3
**"Up-to-date, PHP packages for Alpine Linux."**
Diego Hernandes's avatar
Diego Hernandes committed
4

Diego Hernandes's avatar
Diego Hernandes committed
5
---
Diego Hernandes's avatar
Diego Hernandes committed
6

Diego Hernandes's avatar
Diego Hernandes committed
7
Maintained by **[@hernandev](https://github.com/hernandev)**.
Diego Hernandes's avatar
Diego Hernandes committed
8
9

---
Diego Hernandes's avatar
Diego Hernandes committed
10

Diego Hernandes's avatar
Diego Hernandes committed
11
This project provides a simple alternative for running updated PHP binaries on Alpine Linux.
Diego Hernandes's avatar
Diego Hernandes committed
12

Diego Hernandes's avatar
Diego Hernandes committed
13
We pack and release PHP versions as soon they are available on http://php.net. (At least, we try to.)
Diego Hernandes's avatar
Diego Hernandes committed
14

Diego Hernandes's avatar
Diego Hernandes committed
15
Additionally, many PECL extensions are also available as packages as well.
Diego Hernandes's avatar
Diego Hernandes committed
16

Diego Hernandes's avatar
Diego Hernandes committed
17
---
Diego Hernandes's avatar
Diego Hernandes committed
18

Diego Hernandes's avatar
Diego Hernandes committed
19
## Repositories / Release Cycle / End of Support (EOS)
Diego Hernandes's avatar
Diego Hernandes committed
20

Diego Hernandes's avatar
Diego Hernandes committed
21
This project supports releases that are simultaneously in active support.
Diego Hernandes's avatar
Diego Hernandes committed
22

Diego Hernandes's avatar
Diego Hernandes committed
23
This means, PHP and Alpine must both be in active support.
Diego Hernandes's avatar
Diego Hernandes committed
24

Diego Hernandes's avatar
Diego Hernandes committed
25
Check end of life for each project on the following links:
Diego Hernandes's avatar
Diego Hernandes committed
26

Diego Hernandes's avatar
Diego Hernandes committed
27

Diego Hernandes's avatar
Diego Hernandes committed
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45

## Enf of Support / Release Cycle Chart

Builds for new versions of Alpine and PHP are available as soon as possible.

If either PHP or Alpine release reaches end of support, the repository will stop receiving updates.

Support for both PHP and Alpine are estimated for around 2 years from release date.

<!-- ### PHP End of Support -->
<!-- - **PHP 7.4**     | 2021-11-28   1638057600-->
<!-- PHP 7.3     | 2020-12-06 | 1607212800-->
<!-- Alpine 3.11 | 2021-11-01 | 1635724800-->
<!-- Alpine 3.10 | 2021-05-01 | 1619827200-->
<!-- Alpine 3.9  | 2020-11-01 | 1604188800-->

| Alpine      | PHP                                                                                          |  End of Support  | Repository URL                                                                                |
| -           | -                                                                                            | -                | -                                                                                             |
Diego Hernandes's avatar
badges    
Diego Hernandes committed
46
47
48
49
50
51
| ![Alpine 3.11](https://img.shields.io/badge/Alpine-v3.11-blue?style=for-the-badge) | ![PHP 7.4](https://img.shields.io/badge/PHP-7.4-blueviolet?style=for-the-badge) ![](https://img.shields.io/badge/dynamic/json?label=PHP&query=$.latest_version&style=for-the-badge&color=blueviolet&url=https://api.bintray.com/packages/php-alpine/v3.11/php-7.4) | ![](https://img.shields.io/date/1635724800?label=2021-11-01) | https://dl.bintray.com/php-alpine/v3.11/php-7.4 |
| ![Alpine 3.11](https://img.shields.io/badge/Alpine-v3.11-blue?style=for-the-badge) | ![PHP 7.3](https://img.shields.io/badge/PHP-7.3-blueviolet?style=for-the-badge) ![](https://img.shields.io/badge/dynamic/json?label=PHP&query=$.latest_version&style=for-the-badge&color=blueviolet&url=https://api.bintray.com/packages/php-alpine/v3.11/php-7.3) | ![](https://img.shields.io/date/1607212800?label=2020-12-06) | https://dl.bintray.com/php-alpine/v3.11/php-7.3 |
| ![Alpine 3.10](https://img.shields.io/badge/Alpine-v3.11-blue?style=for-the-badge) | ![PHP 7.4](https://img.shields.io/badge/PHP-7.4-blueviolet?style=for-the-badge) ![](https://img.shields.io/badge/dynamic/json?label=PHP&query=$.latest_version&style=for-the-badge&color=blueviolet&url=https://api.bintray.com/packages/php-alpine/v3.10/php-7.4) | ![](https://img.shields.io/date/1619827200?label=2021-05-01) | https://dl.bintray.com/php-alpine/v3.10/php-7.4 |
| ![Alpine 3.10](https://img.shields.io/badge/Alpine-v3.11-blue?style=for-the-badge) | ![PHP 7.3](https://img.shields.io/badge/PHP-7.3-blueviolet?style=for-the-badge) ![](https://img.shields.io/badge/dynamic/json?label=PHP&query=$.latest_version&style=for-the-badge&color=blueviolet&url=https://api.bintray.com/packages/php-alpine/v3.10/php-7.3) | ![](https://img.shields.io/date/1607212800?label=2020-12-06) | https://dl.bintray.com/php-alpine/v3.10/php-7.3 |
| ![Alpine 3.9](https://img.shields.io/badge/Alpine-v3.11-blue?style=for-the-badge)  | ![PHP 7.4](https://img.shields.io/badge/PHP-7.4-blueviolet?style=for-the-badge) ![](https://img.shields.io/badge/dynamic/json?label=PHP&query=$.latest_version&style=for-the-badge&color=blueviolet&url=https://api.bintray.com/packages/php-alpine/v3.9/php-7.4)  | ![](https://img.shields.io/date/1604188800?label=2020-11-01) | https://dl.bintray.com/php-alpine/v3.9/php-7.4  |
| ![Alpine 3.9](https://img.shields.io/badge/Alpine-v3.11-blue?style=for-the-badge)  | ![PHP 7.3](https://img.shields.io/badge/PHP-7.3-blueviolet?style=for-the-badge) ![](https://img.shields.io/badge/dynamic/json?label=PHP&query=$.latest_version&style=for-the-badge&color=blueviolet&url=https://api.bintray.com/packages/php-alpine/v3.9/php-7.3)  | ![](https://img.shields.io/date/1604188800?label=2020-11-01) | https://dl.bintray.com/php-alpine/v3.9/php-7.4  |
Diego Hernandes's avatar
Diego Hernandes committed
52
53
54
55
56

Active support reference:

- PHP: https://www.php.net/supported-versions.php
- Alpine: https://wiki.alpinelinux.org/wiki/Alpine_Linux:Releases  
Diego Hernandes's avatar
Diego Hernandes committed
57

Fabio Vedovelli's avatar
Fabio Vedovelli committed
58
> Each version is available on a separate repository, choose the one you want and follow the instructions below:
Diego Hernandes's avatar
Diego Hernandes committed
59

Diego Hernandes's avatar
Diego Hernandes committed
60
61
62
63
64
65
66
67
68
69
70
71
## Repository Conflicts

In some cases, the packages on the repositories may present conflicts with official packages.

To solve that, each page was aliases as `php-name`, without the `7` indicator.

Considering this, all installs are now encouraged to reference the virtual names when installing.

The examples on this documentation are now updated to reflect this decision.

The original names are kept, and it should not break working scripts.

Diego Hernandes's avatar
Diego Hernandes committed
72
73
74
75
## Snippets

The following code snippets are intended for quick usage on either shell scripts or Dockerfile

Diego Hernandes's avatar
Diego Hernandes committed
76
77
> Notice that `main` and `community` official repositories must be enabled.

Diego Hernandes's avatar
Diego Hernandes committed
78
79
### Dockerfile

Diego Hernandes's avatar
Diego Hernandes committed
80
You may skip the ca-certificates part if you replace HTTPS by HTTP but you should not. PHP packages will eventually install ca-certificates anyway.
Diego Hernandes's avatar
Diego Hernandes committed
81
82

```dockerfile
83
# Versions 3.8 and 3.7 are current stable supported versions.
Diego Hernandes's avatar
Diego Hernandes committed
84
FROM alpine:3.9
Diego Hernandes's avatar
Diego Hernandes committed
85
86

# trust this project public key to trust the packages.
Diego Hernandes's avatar
Diego Hernandes committed
87
ADD https://dl.bintray.com/php-alpine/key/php-alpine.rsa.pub /etc/apk/keys/php-alpine.rsa.pub
Diego Hernandes's avatar
Diego Hernandes committed
88
89
90
91
92
93
94

## you may join the multiple run lines here to make it a single layer

# make sure you can use HTTPS
RUN apk --update add ca-certificates

# add the repository, make sure you replace the correct versions if you want.
Diego Hernandes's avatar
Diego Hernandes committed
95
RUN echo "https://dl.bintray.com/php-alpine/v3.9/php-7.3" >> /etc/apk/repositories
Diego Hernandes's avatar
Diego Hernandes committed
96
97

# install php and some extensions
Diego Hernandes's avatar
Diego Hernandes committed
98
99
100
RUN apk add --update php
RUN apk add --update php-mbstring
RUN apk add --update php-you-extension-name-here
Diego Hernandes's avatar
Diego Hernandes committed
101
```
Diego Hernandes's avatar
Diego Hernandes committed
102

Diego Hernandes's avatar
Diego Hernandes committed
103
### Bash / Shell scripting
Diego Hernandes's avatar
Diego Hernandes committed
104

Diego Hernandes's avatar
Diego Hernandes committed
105
> You may skip the ca-certificates part if you replace HTTPS by HTTP but you should not. PHP packages will eventually install ca-certificates anyway.
106

Diego Hernandes's avatar
Diego Hernandes committed
107

Diego Hernandes's avatar
Diego Hernandes committed
108
```bash
Diego Hernandes's avatar
Diego Hernandes committed
109
#!/usr/bin/env sh
110

Diego Hernandes's avatar
Diego Hernandes committed
111
112
# install curl and certificates to download the key
apk add --update curl ca-certificates
Diego Hernandes's avatar
Diego Hernandes committed
113

Diego Hernandes's avatar
Diego Hernandes committed
114
# download the repository public key
Diego Hernandes's avatar
Diego Hernandes committed
115
curl https://dl.bintray.com/php-alpine/key/php-alpine.rsa.pub -o /etc/apk/keys/php-alpine.rsa.pub
Diego Hernandes's avatar
Diego Hernandes committed
116

Diego Hernandes's avatar
Diego Hernandes committed
117
# add the repository for the php / alpine version corresponding
Diego Hernandes's avatar
Diego Hernandes committed
118
echo "https://dl.bintray.com/php-alpine/v3.9/php-7.3" >> /etc/apk/repositories
Diego Hernandes's avatar
Diego Hernandes committed
119

Diego Hernandes's avatar
Diego Hernandes committed
120
# install packages
Diego Hernandes's avatar
Diego Hernandes committed
121
122
123
apk add --update php
apk add --update php-redis
apk add --update php-any-other-extension
Diego Hernandes's avatar
Diego Hernandes committed
124

Diego Hernandes's avatar
Diego Hernandes committed
125
126
```

127
128
129

## Available Packages

Diego Hernandes's avatar
Diego Hernandes committed
130
131
This is the complete available packages list:

Diego Hernandes's avatar
Diego Hernandes committed
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
| Package Name          | Type            |
| -                     | -               |
| `php`                 | PHP Core        |
| `php-common`          | PHP Core        |
| `php-fpm`             | PHP Core        |
| `php-cgi`             | PHP Core        |
| `php-apache2`         | PHP Core        |
| `php-doc`             | PHP Core        |
| `php-dev`             | PHP Core        |
|  -                    |                 |
| `php-sodium`          | Core Extension  |
| `php-bcmath`          | Core Extension  |
| `php-bz2`             | Core Extension  |
| `php-calendar`        | Core Extension  |
| `php-ctype`           | Core Extension  |
| `php-curl`            | Core Extension  |
| `php-dba`             | Core Extension  |
| `php-dom`             | Core Extension  |
| `php-embed`           | Core Extension  |
| `php-enchant`         | Core Extension  |
| `php-exif`            | Core Extension  |
| `php-ftp`             | Core Extension  |
| `php-gd`              | Core Extension  |
| `php-gettext`         | Core Extension  |
| `php-gmp`             | Core Extension  |
| `php-iconv`           | Core Extension  |
| `php-imap`            | Core Extension  |
| `php-intl`            | Core Extension  |
| `php-json`            | Core Extension  |
| `php-ldap`            | Core Extension  |
| `php-litespeed`       | Core Extension  |
| `php-mbstring`        | Core Extension  |
| `php-mcrypt`          | Core Extension  |
| `php-mysqli`          | Core Extension  |
| `php-mysqlnd`         | Core Extension  |
| `php-odbc`            | Core Extension  |
| `php-opcache`         | Core Extension  |
| `php-openssl`         | Core Extension  |
| `php-pcntl`           | Core Extension  |
| `php-pdo`             | Core Extension  |
| `php-pdo_dblib`       | Core Extension  |
| `php-pdo_mysql`       | Core Extension  |
| `php-pdo_pgsql`       | Core Extension  |
| `php-pdo_sqlite`      | Core Extension  |
| `php-pear`            | Core Extension  |
| `php-pgsql`           | Core Extension  |
| `php-phar`            | Core Extension  |
| `php-phpdbg`          | Core Extension  |
| `php-posix`           | Core Extension  |
| `php-pspell`          | Core Extension  |
| `php-session`         | Core Extension  |
| `php-shmop`           | Core Extension  |
| `php-snmp`            | Core Extension  |
| `php-soap`            | Core Extension  |
| `php-sockets`         | Core Extension  |
| `php-sqlite3`         | Core Extension  |
| `php-sysvmsg`         | Core Extension  |
| `php-sysvsem`         | Core Extension  |
| `php-tidy`            | Core Extension  |
| `php-wddx`            | Core Extension  |
| `php-xml`             | Core Extension  |
| `php-xmlreader`       | Core Extension  |
| `php-xmlrpc`          | Core Extension  |
| `php-xsl`             | Core Extension  |
| `php-zip`             | Core Extension  |
| `php-zlib`            | Core Extension  |
|  -                    |                 |
| `php-amqp`            | Extra Extension |
| `php-apcu`            | Extra Extension |
| `php-ast`             | Extra Extension |
| `php-ds`              | Extra Extension |
| `php-imagick`         | Extra Extension |
| `php-mailparse`       | Extra Extension |
| `php-memcached`       | Extra Extension |
| `php-mongodb`         | Extra Extension |
| `php-msgpack`         | Extra Extension |
| `php-psr`             | Extra Extension |
| `php-phalcon`         | Extra Extension |
| `php-redis`           | Extra Extension |
| `php-ssh2`            | Extra Extension |
| `php-swoole`          | Extra Extension |
| `php-timecop`         | Extra Extension |
| `php-libsodium`       | Extra Extension |
| `php-scalar_objects`  | Extra Extension |
| `php-secp256k1`       | Extra Extension |
| `php-xdebug`          | Extra Extension |
|  -                    |                 |
| `argon2`              | Extra Package   |
| `argon2-dev`          | Extra Package   |
| `libargon2`           | Extra Package   |
| `secp256k1`           | Extra Package   |

Diego Hernandes's avatar
Diego Hernandes committed
224

Diego Hernandes's avatar
Diego Hernandes committed
225
> Life's good!