The web-push-php is installed using composer.
If Composer is installed skip to Install web-push-php requirments.
Install Composer
Do it locally as unprivileged user.
su username
Then run the commands
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('SHA384', 'composer-setup.php') === '669656bab3166a7aff8a7506b8cb2d1c292f042046c5a994c43155c0be6190fa0355160742ab2e1c88d40d5be660b410') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
mkdir bin
php composer-setup.php --install-dir=bin --filename=composer
php bin/composer
Install web-push-php requirments
It needs php-gmp
On Centos 7 / PHP 56
Do it as root user
yum install ea-php56-php-gmp
For other php versions do:
yum search php-gmp
Install web-push-php
To install web-push-php, and its dependencies we use the composer.
Do it locally as unprivileged user.
su username
Then run the commands
php bin/composer require minishlink/web-push
If every thing go as expected we could see:
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 16 installs, 0 updates, 0 removals
– Installing symfony/polyfill-mbstring (v1.3.0): Downloading (100%)
– Installing beberlei/assert (v2.7.4): Downloading (100%)
– Installing spomky-labs/php-aes-gcm (v1.2.0): Downloading (100%)
– Installing psr/cache (1.0.1): Downloading (100%)
– Installing fgrosse/phpasn1 (1.5.2): Downloading (100%)
– Installing paragonie/random_compat (v2.0.10): Downloading (100%)
– Installing mdanter/ecc (v0.4.2): Downloading (100%)
– Installing symfony/polyfill-php70 (v1.3.0): Downloading (100%)
– Installing spomky-labs/aes-key-wrap (v3.0.3): Downloading (100%)
– Installing spomky-labs/base64url (v1.0.2): Downloading (100%)
– Installing spomky-labs/jose (v6.1.4): Downloading (100%)
– Installing guzzlehttp/promises (v1.3.1): Downloading (100%)
– Installing psr/http-message (1.0.1): Downloading (100%)
– Installing guzzlehttp/psr7 (1.4.2): Downloading (100%)
– Installing guzzlehttp/guzzle (6.2.3): Downloading (100%)
– Installing minishlink/web-push (v1.4.1): Downloading (100%)
spomky-labs/php-aes-gcm suggests installing ext-crypto (Highly recommended for better performance.)
fgrosse/phpasn1 suggests installing php-curl (For loading OID information from the web if they have not bee defined statically)
paragonie/random_compat suggests installing ext-libsodium (Provides a modern crypto API that can be used to generate random bytes.)
spomky-labs/jose suggests installing ext-crypto (Highly recommended when you use AES GCM based algorithms.)
spomky-labs/jose suggests installing ext-curve25519 (For EdDSA with X25519 curves support.)
spomky-labs/jose suggests installing ext-ed25519 (For EdDSA with Ed25519 curves support.)
Writing lock file
Generating autoload files