未加载WebPush gmp扩展,但需要它来发送带负载的推送通知。您可以在php.ini中修复此问题
我正在使用webpush处理通知。我使用link来实现通知推送。我正在搜索和应用上周的每一个解决方案,但同样的问题 我安装了gmp,并在xampp/etc/php.ini中添加了它未加载WebPush gmp扩展,但需要它来发送带负载的推送通知。您可以在php.ini中修复此问题,php,laravel,push-notification,notifications,web-push,Php,Laravel,Push Notification,Notifications,Web Push,我正在使用webpush处理通知。我使用link来实现通知推送。我正在搜索和应用上周的每一个解决方案,但同样的问题 我安装了gmp,并在xampp/etc/php.ini中添加了它 extension = mcrypt.so 这是我的密码 class InvoicePaid extends Notification implements ShouldQueue { use Queueable; public $title, $body; public function
extension = mcrypt.so
这是我的密码
class InvoicePaid extends Notification implements ShouldQueue
{
use Queueable;
public $title, $body;
public function __construct($title, $body)
{
//
$this->title = $title;
$this->body = $body;
}
public function via($notifiable)
{
return [WebPushChannel::class];
}
public function toWebPush($notifiable, $notification)
{
$time = \Carbon\Carbon::now();
return WebPushMessage::create()
// ->id($notification->id)
->title($this->title)
->icon(url('/push.png'))
->body($this->body);
//->action('View account', 'view_account');
}
}
我的路线是
Route::post('/send-notification/{id}', function($id, Request $request){
$user = \App\User::findOrFail($id);
$user->notify(new \App\Notifications\GenericNotification($request->title, $request->body));
return response()->json([
'success' => true
]);
});
但是当我发送通知时,我得到了这个错误
这是gmp安装的图片请尝试转到您的
xampp/php/ext
文件夹
- 检查
是否存在php\u gmp.dll
- 打开
搜索xampp/php/php.ini
,确保它像php_gmp
而不是extension=php_gmp.dll
;extension=php\u gmp.dll
- 打开
- 否则
- 请将
下载到该文件夹,然后重试该过程php\u gmp.dll
- 请将
你不应该再有gmp问题了。Ubuntu18.04,PHP7.4。通过以下命令解决:
您使用的是哪个版本的PHP?请确保安装了PHP gmp并将这一行添加到PHP.ini中:
extension=PHP\u gmp。因此
我安装了PHP gmp并在PHP.ini中添加了这一行。请告诉我如何确保安装了gmp?重新启动服务器。然后在服务器根目录中创建一个名为index.php
或whateveryouwant.php
的文件。将此代码粘贴到该文件中:
。然后导航到http://localhost/index.php
或http://localhost/whateveryouwant.php
在浏览器中检查php配置设置。如果您在那里找到gmp
,则它已安装。GNU gmp支持Stanislav Malyshev这是我在调用phpinfo()f后获得的有关gmp的信息