hyperf / hyperf/hyperf

七牛云上传,在docker环境下上传1.4M及以上大小图片文件,报错

Open
#7,114 1 comment 0 reactions 0 assignees View on GitHub
bug
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);
}
```

报错如下
![image](https://github.com/user-attachments/assets/6ef39784-6be3-457e-836e-b8dbb6b533a5)

但是在php-fpm环境下执行不会出错,并且能够成功上传到七牛

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.