Curloutofmemorywindow PHP calls curl reporting insufficient memory

Source: Internet
Author: User
When calling the Sina Weibo api today (the sdk downloaded from the official website), I found that the image Weibo was not released successfully. the error message is: Fatalerror: triggers (triedtoallocate4294962523bytes) inXXXsdksinasaetv2

When I called the Sina Weibo api today (the sdk downloaded from the official website), I found that I was not successful in publishing Image Weibo. I reported the following error: Fatal error: allowed memory size of 134217728 bytes exhausted (tried to allocate 4294962523 bytes) in XXXsdksinasaetv2.ex. class. php on line 396

I really don't understand. I don't want to upload an image. Do I need such a large memory? I started to think about the SDKs provided on the official website. if there is a code problem, it must have been encountered by other developers, so I went to the Sina Weibo development platform to find the answer, it's strange that no one talks about it (I don't know if everyone has encountered this problem or why ). No way. you can only ask Google.

A check is a bit confusing. most of the reasons for this problem are: use curl to request https. This Post feels okay because a problem occurs when obtaining the certificate: CURLOPT_SSL_VERIFYPEER is in trouble. you can take a look at the children's shoes you are interested in. But this is not my reason. if you don't want to go far, continue to solve your own mistakes.

As the post above does not work, continue to look for it, but the sentence in this reminds me, "the problematic server is Windows, and the job is linux. ". The problem may be caused by the php version or the operating system. Therefore, I tested the code on linux and found that there was no problem yet.

So I added a keyword "window" and searched it again. The php official website appeared in the search results. The answer is here: http://windows.php.net /.

Let's take a look at your php version 5.2.5. if something goes wrong, upgrade it quickly. I don't want to say much, but I found this again when I wrote the article. (using Weibo api to send Weibo posts with images, I am prompted that the memory is insufficient, this guy is much worse than me. it is estimated that the obtained memory is added before it is found to be a bit Untitled, haha ), it's not a waste of effort. (unfortunately, I have discovered the problem, but it hasn't been solved yet ).

Solution:The simple solution is to upgrade php. the dedicated solution is to change the code by yourself. how to change the code is a problem. I said that I am not dedicated and I am too lazy to upgrade it.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.