5
5
[ ![ SensioLabsInsight] ( https://insight.sensiolabs.com/projects/d60e8eea-aea1-4739-8ce0-a3c3c12c6ccf/mini.png )] ( https://insight.sensiolabs.com/projects/d60e8eea-aea1-4739-8ce0-a3c3c12c6ccf )
6
6
7
7
## Installation
8
+ Use [ composer] ( https://getcomposer.org/ ) to download and install the library and its dependencies.
9
+
8
10
` composer require minishlink/web-push `
9
11
10
12
## Usage
@@ -14,7 +16,8 @@ As it is standardized, you don't have to worry about what server type it relies
14
16
15
17
Notifications with payloads are supported with this library on Firefox 46+ and Chrome 50+.
16
18
17
- You'll need at least PHP 5.6, and PHP 7.1 is recommended for much better performance.
19
+ You'll need at least PHP 5.6 with the following extensions enabled: gmp, mbstring, curl, openssl.
20
+ PHP 7.1 is recommended for much better performance.
18
21
19
22
``` php
20
23
<?php
@@ -249,14 +252,24 @@ local public and private keys and compute the shared secret.
249
252
Then, if you have a PHP >= 7.1, WebPush uses ` openssl ` in order to encrypt the payload with the encryption key.
250
253
Otherwise, if you have PHP < 7.1, it uses [ Spomky-Labs/php-aes-gcm] ( https://github.com/Spomky-Labs/php-aes-gcm ) , which is slower.
251
254
252
- ### How to solve "SSL certificate problem: unable to get local issuer certificate" ?
255
+ ### How to solve "SSL certificate problem: unable to get local issuer certificate"?
253
256
Your installation lacks some certificates.
254
257
255
258
1 . Download [ cacert.pem] ( http://curl.haxx.se/ca/cacert.pem ) .
256
259
2 . Edit your ` php.ini ` : after ` [curl] ` , type ` curl.cainfo = /path/to/cacert.pem ` .
257
260
258
261
You can also force using a client without peer verification.
259
262
263
+ ### How to solve "Bad key encryption key length"?
264
+ Disable ` mbstring.func_overload ` in your ` php.ini ` .
265
+
266
+ ### How to solve "Class 'Minishlink\WebPush\WebPush' not found"
267
+ Make sure to require Composer's [ autoloader] ( https://getcomposer.org/doc/01-basic-usage.md#autoloading ) .
268
+
269
+ ``` php
270
+ require __DIR__ . '/path/to/vendor/autoload.php';
271
+ ```
272
+
260
273
### I lost my VAPID keys!
261
274
See [ issue #58 ] ( https://github.com/web-push-libs/web-push-php/issues/58 ) .
262
275
0 commit comments