shopware 6 购物车 API 内存不足
我构建了一个配置产品包的应用程序,最后一个操作是将产品添加到购物车。我对 /store-api/context 进行 API 调用,然后将令牌设置为 sw-context-key 以使用正文再次调用 /store-api/checkout/cart/line-item:
{
"items": [
{
"id":"5a48801fa3164919b44bfc95bc5cf6831",
"referenceId":"5a48801fa3164919b44bfc95bc5cf6831",
"quantity":2,
"type":"product"
},
{
"id":"ed6149fc89834a7ebadde07c18509a4a1",
"referenceId":"ed6149fc89834a7ebadde07c18509a4a1",
"quantity":1,
"type":"product"
}
]
}
不幸的是,来自服务器始终出现内部服务器错误,并显示“错误:允许的内存大小 4294967296 字节已耗尽”。 令我惊讶的是,根据phpinfo();,内存限制被设置为4096M。
数据库产品表包含219000条条目。即使我将内存限制设置为32768M也不起作用,这很奇怪。也许有人已经找到了一个解决方案,可以给我一个提示,我必须如何正确配置 php,以便 api 可以正常工作。
I have built an app that configures product bundles, the last action is to add the products to the cart. I make an API call to /store-api/context and then set the token as sw-context-key to make another call to /store-api/checkout/cart/line-item with the body:
{
"items": [
{
"id":"5a48801fa3164919b44bfc95bc5cf6831",
"referenceId":"5a48801fa3164919b44bfc95bc5cf6831",
"quantity":2,
"type":"product"
},
{
"id":"ed6149fc89834a7ebadde07c18509a4a1",
"referenceId":"ed6149fc89834a7ebadde07c18509a4a1",
"quantity":1,
"type":"product"
}
]
}
Unfortunately the response from the server is always an internsal server error with "Error: Allowed memory size of 4294967296 bytes exhausted".
What surprises me is that the memory_limit is set to 4096M according to phpinfo();.
The database product table includes 219000 entries. Even if I set the memory_limit to 32768M it does not work, that is very strange. Maybe someone has found a solution for this of can give me a hint how I have to configure php right, so the api can work correctly.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论