PHP的致命错误:内存(分配1707606016)(试图分配426680697字节) [英] PHP Fatal error: Out of memory (allocated 1707606016) (tried to allocate 426680697 bytes)

查看:762
本文介绍了PHP的致命错误:内存(分配1707606016)(试图分配426680697字节)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有DigitalOcean液滴,这是一个$ 10包1GB内存,那么我升级到$ 20包。

I have a droplet on DigitalOcean, it was a 10$ package with 1GB Memory, then I upgraded to 20$ package.

那么,如何这一切开始的是,我试图从一台服务器上的文件上传到另一个使用卷曲的参数,现在的问题是...该文件不发,因为我得到这个美丽的错误。

So how it all started was that I'm trying to upload a file from one server to another using cURL parameters, now the issue is... The file doesn't send because I get this beautiful error.

PHP Fatal error:  Out of memory (allocated 1707606016) (tried to allocate 426680697 bytes)

现在我有 memory_limit的设置为2048MB,因为这是多么的内存多MB我对我的VPS了。现在我升级之前,我只有内存1024MB和错误消息是在不同的时间,这是我得到了什么。

Now I have memory_limit set to 2048MB because that's how much MB of memory I got on my VPS. Now before I upgraded, I had only 1024MB of memory and the error message was different at the time, and this is what I got.

PHP Fatal error:  Out of memory (allocated 530055168) (tried to allocate 529639729 bytes) 

我的VPS比足够的内存来上传403MB的文件多了,我有我的memory_limit的淋漓尽致,有没有办法,我需要升级服务器的内存限制。

My VPS has MORE than enough memory to upload a 403MB file, and I have my memory_limit maxed, there's no way I need to upgrade the servers memory limit.

memory_limit = 2048M
file_uploads = On
upload_max_filesize = 5000M
max_file_uploads = 20
allow_url_fopen = On
post_max_size = 0
max_execution_time = 90000
max_input_time = 90000

很明显,这可能看起来像一个重复的,但在所有我看过职位的解决方案没有为我工作。这是有其memory_limit的剧本简直是处理来自备用服务器发送请求,卷曲的处理程序。

Obviously it may look like a duplicate, but the solutions on all of the posts I've looked at don't work for me. The script that is having its memory_limit is literally a handler that handles the cURL request sent from the alternative server.

推荐答案

按我的知识,我们可以通过两种方式acheive您的需要。

As per my knowledge we can acheive your need via two ways.

1) Modifying the .htaccess file to Increase Memory Limit
2) you had already done that is  php.ini

否则

Changing the Limits in WHM

如果您的网站上VPS或专用服务器托管,你可以尝试在你的WHM改变上传和内存限制。

If your site is hosted on a VPS or dedicated server, you can try changing the upload and memory limits in your WHM.

一旦你登录,进入服务器配置>调整设置> PHP。

Once you have logged in, go to Server Configuration > Tweak Settings > PHP.

或此链接可能会有所帮助。

Or this link might be helpful

https://premium.wpmudev.org/blog/increase-memory-limit/

这篇关于PHP的致命错误:内存(分配1707606016)(试图分配426680697字节)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆