hprose / hprose-php

Hprose is a cross-language RPC. This project is Hprose 3.0 for PHP
MIT License
1.97k stars 390 forks source link

报错 找不到这个类 Hprose\BytesIO #141

Open 2102237144 opened 4 years ago

2102237144 commented 4 years ago

PHP Fatal error: Uncaught Error: Class 'Hprose\BytesIO' not found in /www/hprose-php/src/Hprose/RPC/Core/DefaultServiceCodec.php:31

代码 <?php include '/www/hprose-php/src/Hprose.php';

use Hprose\RPC\Http\HttpServer; use Hprose\RPC\Service;

function hello(string $name): string { return "Hello " . $name . "!"; }

$service = new Service(); $service->addCallable("hello", "hello"); $server = new HttpServer(); $service->bind($server); $server->listen(); ~

2102237144 commented 4 years ago

PHP Fatal error: Uncaught Error: Class 'Hprose\BytesIO' not found in /www/hprose-php/src/Hprose/RPC/Core/DefaultServiceCodec.php:31

代码

include '/www/hprose-php/src/Hprose.php';

use Hprose\RPC\Http\HttpServer; use Hprose\RPC\Service;

function hello(string $name): string { return "Hello " . $name . "!"; }

$service = new Service(); $service->addCallable("hello", "hello"); $server = new HttpServer(); $service->bind($server); $server->listen(); ~

andot commented 4 years ago

需要安装 hprose 的 pecl 扩展。

2102237144 commented 4 years ago

需要安装 hprose 的 pecl 扩展。

好的,谢谢!