wechaty / php-wechaty

PHP Wechaty is a Conversational SDK for Chatbot Makers Written in PHP https://github.com/wechaty/docker-php-wechaty-getting-started
https://github.com/wechaty/php-wechaty-getting-started
Apache License 2.0
59 stars 21 forks source link

Class 'Grpc\ChannelCredentials' not found #4

Closed BigXia closed 2 years ago

BigXia commented 3 years ago

PHP 7.4.13 MacOS 10.15.6 报错not found,请问怎么解决?

image

huan commented 3 years ago

Have you tried our PHP Wechaty Getting Started repo at https://github.com/wechaty/php-wechaty-getting-started ?

I believe that repo should be a good entry to start.

BigXia commented 3 years ago

Have you tried our PHP Wechaty Getting Started repo at https://github.com/wechaty/php-wechaty-getting-started ?

I believe that repo should be a good entry to start.

image

Can not work normally,too.

zhangchunsheng commented 3 years ago

You should install php extension first. Then use composer to install the Grpc.

composer config repo.packagist composer https://mirrors.aliyun.com/composer/
# https://packagist.org/packages/wechaty/php-wechaty
composer require wechaty/php-wechaty

You can get the requires in composer.json file.

"require": {
    "php": "^7.4 || ^8.0",
    "grpc/grpc": "^v1.3.0",
    "google/protobuf": "^v3.3.0",
    "wechaty/php-grpc": "^v0.16.2",
    "guzzlehttp/guzzle": "^7.0",
    "zhangchunsheng/php-qrcode": "^v0.0.2",
    "imangazaliev/didom": "^v1.16"
  },

You can use yum on CentOS.

sudo yum install php-pecl-grpc
sudo yum install php-pecl-protobuf
sudo yum install php-pecl-yac
sudo yum install php-xml
zhangchunsheng commented 2 years ago

see https://github.com/wechaty/docker-php-wechaty-getting-started