七牛云上传,在docker环境下上传1.4M及以上大小图片文件,报错
- Dominant language
- PHP
- Stars
- 6.9k
- Forks
- 1.3k
- Avg merge
- 4h 21m
- Merged PRs (30d)
- 4
Description
docker环境下会报错,docker 镜像:hyperf/hyperf:8.1-alpine-v3.18-swoole
非docker环境没有问题
## hyperf 代码
```php
#[Inject]
protected Filesystem $filesystem;
public function handle()
{
$file = BASE_PATH . '/storage/image/test-2.jpg'; // 图片1.4M
$content = file_get_contents($file);
try {
$this->filesystem->write(
'test/test-' . mt_rand(10000000, 99999999) . '.jpg',
$content
);
} catch (FilesystemException $e) {
throw new Exception($e->getMessage());
}
}
```
由于hyperf框架中存在报错,于是我把代码全部拉出来,还是报错
```php
write('test/test-'.mt_rand(10000000, 99999999).'.jpg', $content);
} catch (Exception $e) {
dump($e);
}
```
报错如下

但是在php-fpm环境下执行不会出错,并且能够成功上传到七牛
Contributor guide
Assessment
This issue has not been assessed yet.