Unverified Commit ee30cabe authored by Diego Hernandes's avatar Diego Hernandes Committed by GitHub
Browse files

Merge pull request #34 from codecasts/feature/updates

Improvements on PHP-Alpine
parents 64ea432f 5ff1caa2
......@@ -20,7 +20,7 @@ Additionally, many PECL extensions are also available as packages as well.
For short, this project will support **2 minor version of both PHP and Alpine** at time.
## Available Repositores
## Available Repositories
| Alpine Version | PHP Version | Status | Repository URL
| - | - | - | -
......@@ -35,6 +35,18 @@ For short, this project will support **2 minor version of both PHP and Alpine**
> Each version is available on a separate repository, choose the one you want and follow the instructions below:
## 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.
## Snippets
The following code snippets are intended for quick usage on either shell scripts or Dockerfile
......@@ -43,7 +55,7 @@ The following code snippets are intended for quick usage on either shell scripts
### Dockerfile
You may skil the ca-certificates part if you replace HTTPS by HTTP but you should not. PHP packages will eventually install ca-certificates anyway.
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.
```dockerfile
# change to Alpine 3.6 you like.
......@@ -62,9 +74,9 @@ RUN echo "@php https://php.codecasts.rocks/v3.7/php-7.2" >> /etc/apk/repositorie
# install php and some extensions
# notice the @php is required to avoid getting default php packages from alpine instead.
RUN apk add --update php7@php
RUN apk add --update php7-mbstring@php
RUN apk add --update php7-you-extension-name-here@php
RUN apk add --update php@php
RUN apk add --update php-mbstring@php
RUN apk add --update php-you-extension-name-here@php
```
### Bash / Shell scripting
......@@ -86,9 +98,9 @@ echo "@php https://php.codecasts.rocks/v3.7/php-7.2" >> /etc/apk/repositories
# install packages
# notice that @php is required so you don't end up with default outdated php packages from community repository.
apk add --update php7@php
apk add --update php7-redis@php
apk add --update php7-any-other-extension@php
apk add --update php@php
apk add --update php-redis@php
apk add --update php-any-other-extension@php
```
......@@ -105,15 +117,15 @@ Argon2 was backported from EDGE branch of `ports` to allow PHP to be compiled wi
- **Core Packages (Provide Binaries or Modules)**
`php7` `php7-common` `php7-fpm` `php7-cgi` `php7-apache2`
`php` `php-common` `php-fpm` `php-cgi` `php-apache2`
- **Special Packages (Not needed at runtime)**
`php7-doc` `php7-dev`
`php-doc` `php-dev`
- **PHP 7.2 only extensions**
`php7-sodium`
`php-sodium`
> `libsodium` extension is now part of PHP 7.2, it got renamed to `sodium` only and it reflects the version 2 of the extension.
> The original extension, at version 1 was kept built for PHP 7.2 for legacy purposes, be sure to not install the two extensions together and hope it will work (it actually may but I don't adivise you to try).
......@@ -121,25 +133,25 @@ Argon2 was backported from EDGE branch of `ports` to allow PHP to be compiled wi
- **Core Extensions**
`php7-bcmath` `php7-bz2` `php7-calendar` `php7-ctype` `php7-curl` `php7-dba`
`php-bcmath` `php-bz2` `php-calendar` `php-ctype` `php-curl` `php-dba`
`php7-dom` `php7-embed` `php7-enchant` `php7-exif` `php7-ftp` `php7-gd`
`php-dom` `php-embed` `php-enchant` `php-exif` `php-ftp` `php-gd`
`php7-gettext` `php7-gmp` `php7-iconv` `php7-imap` `php7-intl` `php7-json`
`php-gettext` `php-gmp` `php-iconv` `php-imap` `php-intl` `php-json`
`php7-ldap` `php7-litespeed` `php7-mbstring` `php7-mcrypt` `php7-mysqli`
`php-ldap` `php-litespeed` `php-mbstring` `php-mcrypt` `php-mysqli`
`php7-mysqlnd` `php7-odbc` `php7-opcache` `php7-openssl` `php7-pcntl`
`php-mysqlnd` `php-odbc` `php-opcache` `php-openssl` `php-pcntl`
`php7-pdo` `php7-pdo_dblib` `php7-pdo_mysql` `php7-pdo_pgsql` `php7-pdo_sqlite`
`php-pdo` `php-pdo_dblib` `php-pdo_mysql` `php-pdo_pgsql` `php-pdo_sqlite`
`php7-pear` `php7-pgsql` `php7-phar` `php7-phpdbg` `php7-posix` `php7-pspell`
`php-pear` `php-pgsql` `php-phar` `php-phpdbg` `php-posix` `php-pspell`
`php7-session` `php7-shmop` `php7-snmp` `php7-soap` `php7-sockets` `php7-sqlite3`
`php-session` `php-shmop` `php-snmp` `php-soap` `php-sockets` `php-sqlite3`
`php7-sysvmsg` `php7-sysvsem` `php7-sysvshm` `php7-tidy` `php7-wddx` `php7-xml`
`php-sysvmsg` `php-sysvsem` `php-sysvshm` `php-tidy` `php-wddx` `php-xml`
`php7-xmlreader` `php7-xmlrpc` `php7-xsl` `php7-zip` `php7-zlib`
`php-xmlreader` `php-xmlrpc` `php-xsl` `php-zip` `php-zlib`
- **Additional Extensions**
......@@ -147,14 +159,14 @@ Some additional PECL extensions are provided so you don't need to build them.
| Extension | Package Name | Current Version | Available on 7.2 | Available on 7.1 |
|--------------------------|----------------|-----------------|------------------|------------------|
| APCu | php7-apcu | 5.1.11 | Yes | Yes |
| Imagick | php7-imagick | 3.4.3 | Yes | Yes |
| libsodium _(legacy v1)_ | php7-libsodium | 1.0.7 | Yes | Yes |
| memcached | php7-memcached | 3.0.4 | Yes | Yes |
| MongoDB | php7-mongodb | 1.4.2 | Yes | Yes |
| Redis | php7-redis | 3.1.6 | Yes | Yes |
| SSH2 | php7-ssh2 | 1.1.2 | Yes | Yes |
| xDebug | php7-xdebug | 2.6.0 | Yes | Yes |
| APCu | php-apcu | 5.1.11 | Yes | Yes |
| Imagick | php-imagick | 3.4.3 | Yes | Yes |
| libsodium _(legacy v1)_ | php-libsodium | 1.0.7 | Yes | Yes |
| memcached | php-memcached | 3.0.4 | Yes | Yes |
| MongoDB | php-mongodb | 1.4.2 | Yes | Yes |
| Redis | php-redis | 3.1.6 | Yes | Yes |
| SSH2 | php-ssh2 | 1.1.2 | Yes | Yes |
| xDebug | php-xdebug | 2.6.0 | Yes | Yes |
## Enjoy Life
......@@ -3,13 +3,13 @@
pkgname=php7-imagick
_pkgreal=imagick
pkgver=3.4.3
pkgrel=3
pkgrel=7
_phpver=7
pkgdesc="ImageMagick extension for PHP"
url="http://pecl.php.net/package/$_pkgreal"
arch="all"
license="PHP-3"
depends="php7-common>=7.1.0 php7-common<7.2.0"
depends="php7-common>=7.1.0 php7-common<7.2.0 imagick"
makedepends="php7-dev>=7.1.0 php7-dev<7.2.0 autoconf imagemagick-dev libtool pcre-dev"
source="http://pecl.php.net/get/$_pkgreal-$pkgver.tgz"
builddir="$srcdir/$_pkgreal-$pkgver"
......
# This package is being back-ported to support PHP 7.2 Argon2 password_hash() algo.
# This package is being back-ported to support PHp 7.2 Argon2 password_hash() algo.
# Original file: https://github.com/alpinelinux/aports/blob/master/testing/argon2/APKBUILD
# Any license indication here contained takes lesser precedence than the original
......@@ -9,8 +9,9 @@
pkgname=argon2
_pkgname=phc-winner-argon2
pkgver=20161029
provides="php-argon2=7.2"
_soname=0.0.0
pkgrel=1
pkgrel=10
pkgdesc="The password hash Argon2, winner of PHC"
url="https://github.com/P-H-C/phc-winner-argon2"
arch="all !armhf"
......
......@@ -10,7 +10,6 @@ ROOT_PATH=$(pwd)
# cd $ROOT_PATH/php7
# abuild -r
# update packages.
sudo apk update
for PACKAGE in $PACKAGES; do
......
......@@ -3,14 +3,15 @@
pkgname=php7-apcu
_pkgreal=apcu
pkgver=5.1.11
pkgrel=0
pkgrel=10
_phpver=7
provides="php-apcu=7.2"
pkgdesc="APCu - APC User Cache extension for PHP"
url="http://pecl.php.net/package/$_pkgreal"
arch="all"
license="PHP-3"
depends="php7-common>7.2.0 php7-common<7.3.0"
makedepends="php7-dev>7.2.0 php7-dev<7.3.0 autoconf pcre-dev"
depends="php7-common>=7.2.0 php7-common<7.3.0"
makedepends="php7-dev>=7.2.0 php7-dev<7.3.0 autoconf pcre-dev"
source="http://pecl.php.net/get/$_pkgreal-$pkgver.tgz"
builddir="$srcdir/$_pkgreal-$pkgver"
......
......@@ -3,13 +3,14 @@
pkgname=php7-imagick
_pkgreal=imagick
pkgver=3.4.3
pkgrel=6
pkgrel=10
_phpver=7
provides="php-imagick=7.2"
pkgdesc="ImageMagick extension for PHP"
url="http://pecl.php.net/package/$_pkgreal"
arch="all"
license="PHP-3"
depends="php7-common>=7.2.0 php7-common<7.3.0"
depends="php7-common>=7.2.0 php7-common<7.3.0 imagemagick"
makedepends="php7-dev>=7.2.0 php7-dev<7.3.0 autoconf imagemagick-dev libtool pcre-dev"
source="http://pecl.php.net/get/$_pkgreal-$pkgver.tgz"
builddir="$srcdir/$_pkgreal-$pkgver"
......
......@@ -3,8 +3,9 @@
pkgname=php7-libsodium
_pkgreal=libsodium
pkgver=1.0.7
pkgrel=6
pkgrel=10
_phpver=7
provides="php-libsodium=7.2"
pkgdesc="xDebug Profiler"
url="http://pecl.php.net/package/$_pkgreal"
arch="all"
......
......@@ -3,8 +3,9 @@
pkgname=php7-memcached
_pkgreal=memcached
pkgver=3.0.4
pkgrel=6
pkgrel=10
_phpver=7
provides="php-memcached=7.2"
pkgdesc="Memcached extension for PHP"
url="http://pecl.php.net/package/$_pkgreal"
arch="all"
......
......@@ -3,8 +3,9 @@
pkgname=php7-mongodb
_pkgreal=mongodb
pkgver=1.4.2
pkgrel=0
pkgrel=10
_phpver=7
provides="php-mongodb=7.2"
pkgdesc="MongoDB extension for PHP"
url="http://pecl.php.net/package/$_pkgreal"
arch="all"
......
......@@ -2,8 +2,9 @@
pkgname=php7-redis
_pkgreal=redis
pkgver=3.1.6
pkgrel=0
pkgrel=10
_phpver=7
provides="php-redis=7.2"
pkgdesc="Redis extension for PHP"
url="http://pecl.php.net/package/$_pkgreal"
arch="all"
......
......@@ -3,8 +3,9 @@
pkgname=php7-ssh2
_pkgreal=ssh2
pkgver=1.1.2
pkgrel=6
pkgrel=10
_phpver=7
provides="php-ssh2=7.2"
pkgdesc="ssh2 - Bindings for the libssh2 library extension for PHP"
url="http://pecl.php.net/package/$_pkgreal"
arch="all"
......
......@@ -3,8 +3,9 @@
pkgname=php7-xdebug
_pkgreal=xdebug
pkgver=2.6.0
pkgrel=4
pkgrel=10
_phpver=7
provides="php-xdebug=7.2"
pkgdesc="xDebug Profiler"
url="http://pecl.php.net/package/$_pkgreal"
arch="all"
......
......@@ -5,13 +5,14 @@
pkgname=php7
_pkgreal=php
pkgver=7.2.3
pkgrel=0
pkgver=7.2.4
pkgrel=100
pkgdesc="The PHP language runtime engine - 7th branch"
url="http://www.php.net/"
arch="all"
license="PHP-3"
options=""
provides="$_pkgreal=7.2"
depends="$pkgname-common>=7.2.0 $pkgname-common<7.3.0"
depends_dom="$pkgname-xml>=7.2.0 $pkgname-xml<7.3.0"
depends_mysqlnd="$pkgname-mysqli>=7.2.0 $pkgname-mysqli<7.3.0"
......@@ -22,7 +23,7 @@ depends_wddx="$pkgname-xml>=7.2.0 $pkgname-xml<7.3.0"
depends_xmlreader="$pkgname-dom>=7.2.0 $pkgname-dom<7.3.0"
depends_xmlrpc="$pkgname-xml>=7.2.0 $pkgname-xml<7.3.0"
depends_xsl="$pkgname-dom>=7.2.0 $pkgname-dom<7.3.0"
makedepends="autoconf bison re2c apache2-dev libxml2-dev libxslt-dev libzip-dev bzip2-dev zlib-dev
makedepends="autoconf argon2-dev bison re2c apache2-dev libxml2-dev libxslt-dev libzip-dev bzip2-dev zlib-dev
aspell-dev enchant-dev expat-dev pcre-dev curl-dev gmp-dev icu-dev imap-dev
libical-dev libsodium-dev libressl-dev openldap-dev net-snmp-dev db-dev krb5-dev gdbm-dev sqlite-dev
freetds-dev mariadb-dev postgresql-dev unixodbc-dev freetype-dev tidyhtml-dev libxpm-dev
......@@ -85,6 +86,7 @@ _build() {
--localstatedir=/var \
--with-layout=GNU \
--with-pic \
--with-password-argon2 \
--with-pear=/usr/share/$pkgname \
--with-config-file-path=/etc/$pkgname \
--with-config-file-scan-dir=/etc/$pkgname/conf.d \
......@@ -198,7 +200,8 @@ package() {
dev() {
default_dev
depends="$depends $pkgname $pkgname-pear"
provides="$_pkgreal-dev=7.2"
depends="$depends $pkgname>=7.2.0 $pkgname<7.3.0 $pkgname-pear>=7.2.0 $pkgname-pear<7.3.0"
mkdir -p "$subpkgdir"/usr/bin \
"$subpkgdir"/usr/lib/$pkgname
......@@ -211,7 +214,7 @@ dev() {
doc() {
default_doc
provides="$_pkgreal-doc=7.2"
mkdir -p "$subpkgdir"/usr/share/doc/$pkgname
local file
......@@ -222,8 +225,8 @@ doc() {
apache2() {
pkgdesc="PHP Module for Apache2"
depends="$pkgname-common apache2"
depends="$pkgname-common>=7.2.0 $pkgname-common<7.3.0 apache2"
provides="$_pkgreal-apache2=7.2"
install -D -m755 "$builddir"/sapi/apache2handler/mod_php7.so \
"$subpkgdir"/usr/lib/apache2/mod_php7.so || return 1
......@@ -233,40 +236,40 @@ apache2() {
phpdbg() {
pkgdesc="Interactive PHP debugger"
depends="$pkgname-common"
depends="$pkgname-common>=7.2.0 $pkgname-common<7.3.0"
provides="$_pkgreal-phpdbg=7.2"
install -Dm755 "$builddir"/sapi/phpdbg/phpdbg \
"$subpkgdir"/usr/bin/phpdbg7
}
embed() {
pkgdesc="PHP Embedded Library"
depends="$pkgname-common"
depends="$pkgname-common>=7.2.0 $pkgname-common<7.3.0"
provides="$_pkgreal-embed=7.2"
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/lib/libphp*.so "$subpkgdir"/usr/lib/
}
litespeed() {
pkgdesc="PHP LiteSpeed SAPI"
depends="$pkgname-common"
depends="$pkgname-common>=7.2.0 $pkgname-common<7.3.0"
provides="$_pkgreal-litespeed=7.2"
mkdir -p "$subpkgdir"/usr/bin
# mv "$pkgdir"/usr/bin/lsphp "$subpkgdir"/usr/bin/lsphp7
}
cgi() {
pkgdesc="PHP Common Gateway Interface"
depends="$pkgname-common"
depends="$pkgname-common>=7.2.0 $pkgname-common<7.3.0"
provides="$_pkgreal-cgi=7.2"
mkdir -p "$subpkgdir"/usr/bin
mv "$pkgdir"/usr/bin/php-cgi7 "$subpkgdir"/usr/bin/
}
fpm() {
pkgdesc="PHP FastCGI Process Manager"
depends="$pkgname-common"
depends="$pkgname-common>=7.2.0 $pkgname-common<7.3.0"
provides="$_pkgreal-fpm=7.2"
mv "$pkgdir"/var "$subpkgdir"/ || return 1
mkdir -p "$subpkgdir"/etc/$pkgname \
......@@ -289,8 +292,8 @@ fpm() {
pear() {
pkgdesc="PHP Extension and Application Repository"
depends="$pkgname $pkgname-xml"
depends="$pkgname>=7.2.0 $pkgname<7.3.0 $pkgname-xml>=7.2.0 $pkgname-xml<7.3.0"
provides="$_pkgreal-pear=7.2"
mkdir -p "$subpkgdir"/usr/bin \
"$subpkgdir"/etc/$pkgname
......@@ -304,7 +307,7 @@ pear() {
common() {
pkgdesc="$pkgdesc (common config)"
depends=""
provides="$_pkgreal-common=7.2"
mkdir -p "$subpkgdir"/usr
mv "$pkgdir"/usr/lib "$subpkgdir"/usr/ || return 1
mv "$pkgdir"/etc "$subpkgdir"/ || return 1
......@@ -313,6 +316,7 @@ common() {
}
phar() {
provides="$_pkgreal-phar=7.2"
_package_ext || return 1
mkdir -p "$subpkgdir"/usr/bin
mv "$pkgdir"/usr/bin/phar* "$subpkgdir"/usr/bin/
......@@ -323,7 +327,7 @@ _package_ext() {
local extdepends="$(eval "echo \$depends_$extname")"
pkgdesc="PHP7 extension: $extname"
depends="$depends $extdepends"
provides="$_pkgreal-$extname=7.2"
case "$extname" in
pdo_*) depends="$depends $pkgname-pdo>=7.2.0 $pkgname-pdo<7.3.0"
esac
......@@ -348,7 +352,7 @@ _package_ext() {
> "$subpkgdir"/etc/$pkgname/conf.d/${elo}_${extname}.ini
}
sha512sums="6b7e3e86ed42fb48762309a20c6a519202d2454fcb7be51e328ca47a3ca5fdbff8d21a435c31b4e73a9901b733cacd39d4a5287c16cced135799d2117a789e90 php-7.2.3.tar.bz2
sha512sums="036348c7dd1b14cb8d843682a800c396a2a712db3113fb1443826171d4fc75e326b1e239807cd59cbc3c703ffdba3e2a48033052c01552dd1c9454c6abf20fe0 php-7.2.4.tar.bz2
5b45e3f76579c064e7393a080584515d4c70071cd028cd9292885c741ddc78731633082cf1808b34bbe2e54575caa4c6fcfb3da05f54a26f0848a5e1709492ac php7-fpm.initd
100434b8cecaa01a86cc8be56434db1c2dd3c49b7ae397a58b8ecad06a4eb5453e05412e20df1fa26468d6df6c4260f7c3c2b4b4c6f099ffec006bcc0c29cc3c php7-fpm.logrotate
7893c2c4507191ce39fa0813c0119ccb8394dbc5ec0092faea34d6494459c697f70536f19a4c7b767aa1a8c587fe49768b552e3b55a1fc11a1e66f267e0b605e php7-module.conf
......
......@@ -3,8 +3,9 @@
pkgname=php7-apcu
_pkgreal=apcu
pkgver=5.1.11
pkgrel=0
pkgrel=10
_phpver=7
provides="php-$_pkgreal=7.1"
pkgdesc="APCu - APC User Cache extension for PHP"
url="http://pecl.php.net/package/$_pkgreal"
arch="all"
......
......@@ -3,13 +3,14 @@
pkgname=php7-imagick
_pkgreal=imagick
pkgver=3.4.3
pkgrel=4
pkgrel=10
_phpver=7
provides="php-$_pkgreal=7.1"
pkgdesc="ImageMagick extension for PHP"
url="http://pecl.php.net/package/$_pkgreal"
arch="all"
license="PHP-3"
depends="php7-common>=7.1.0 php7-common<7.2.0"
depends="php7-common>=7.1.0 php7-common<7.2.0 imagemagick"
makedepends="php7-dev>=7.1.0 php7-dev<7.2.0 autoconf imagemagick-dev libtool pcre-dev"
source="http://pecl.php.net/get/$_pkgreal-$pkgver.tgz"
builddir="$srcdir/$_pkgreal-$pkgver"
......
......@@ -3,8 +3,9 @@
pkgname=php7-libsodium
_pkgreal=libsodium
pkgver=1.0.7
pkgrel=0
pkgrel=10
_phpver=7
provides="php-$_pkgreal=7.1"
pkgdesc="xDebug Profiler"
url="http://pecl.php.net/package/$_pkgreal"
arch="all"
......
......@@ -3,8 +3,9 @@
pkgname=php7-memcached
_pkgreal=memcached
pkgver=3.0.4
pkgrel=0
pkgrel=10
_phpver=7
provides="php-$_pkgreal=7.1"
pkgdesc="Memcached extension for PHP"
url="http://pecl.php.net/package/$_pkgreal"
arch="all"
......
......@@ -3,8 +3,9 @@
pkgname=php7-mongodb
_pkgreal=mongodb
pkgver=1.4.2
pkgrel=0
pkgrel=10
_phpver=7
provides="php-$_pkgreal=7.1"
pkgdesc="MongoDB extension for PHP"
url="http://pecl.php.net/package/$_pkgreal"
arch="all"
......
......@@ -2,8 +2,9 @@
pkgname=php7-redis
_pkgreal=redis
pkgver=3.1.6
pkgrel=0
pkgrel=10
_phpver=7
provides="php-$_pkgreal=7.1"
pkgdesc="Redis extension for PHP"
url="http://pecl.php.net/package/$_pkgreal"
arch="all"
......
......@@ -3,8 +3,9 @@
pkgname=php7-ssh2
_pkgreal=ssh2
pkgver=1.1.2
pkgrel=3
pkgrel=10
_phpver=7
provides="php-$_pkgreal=7.1"
pkgdesc="ssh2 - Bindings for the libssh2 library extension for PHP"
url="http://pecl.php.net/package/$_pkgreal"
arch="all"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment