简体   繁体   English

PHP / ProcessWire CMS和session.save_handler = redis / memcached在并行文件上传时出现问题

[英]Problems at parallel fileupload with PHP/ProcessWire CMS and session.save_handler = redis/memcached

I have an issue with PHP when I use session with save_handler redis or memcached. 当我使用带有save_handler redis或memcached的会话时,PHP出现问题。

I use the ProcessWire CMS and both session handler method working generally fine but I found one strange behaviour: I can't upload multiple images in parallel. 我使用ProcessWire CMS,并且两种会话处理程序方法都可以正常工作,但是我发现了一个奇怪的行为:我不能并行上传多个图像。 The image which finishes at least are overriding all other uploaded images in the database. 至少完成的图像将覆盖数据库中所有其他上载的图像。

Since yet, nobody used really ProcessWire with this session handlers and I guess it isn't a bug in ProcessWire itself. 从那时起,没有人真正使用ProcessWire与此会话处理程序,我想这不是ProcessWire本身的错误。 Maybe it is a bug in phpredis, memcached extension or PHP itself or I have some wrong configuration. 也许这是phpredis,memcached扩展或PHP本身中的错误,或者我有一些错误的配置。

I used following in php.ini: 我在php.ini中使用了以下命令:

For Redis: 对于Redis:

session.save_handler = redis
session.save_path = "tcp://127.0.0.1:6379"

For memcached: 对于memcached:

session.save_handler = memcached
session.save_path = "127.0.0.1:11211"

Could it depend on something like session locking? 它可以依赖于会话锁定之类的东西吗? Deactivating/activating it doesn't help me. 停用/激活它对我没有帮助。

The issue in the processwire github repo: https://github.com/processwire/processwire-issues/issues/798 processwire github存储库中的问题: https : //github.com/processwire/processwire-issues/issues/798

I found a solution. 我找到了解决方案。 I added following to my php.ini 我在我的php.ini中添加了以下内容

redis.session.locking_enabled = 1
redis.session.lock_expire = 60
redis.session.lock_retries = -1

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM