In curloutofmemorywindow, PHP calls curl to report insufficient memory. This article will introduce you to the solution to curloutofmemory errors when PHP calls curl in the window. if you encounter such problems, refer. Today, I am calling Sina micro. This article will introduce you to the solution to the insufficient memory (curl out of memory) error reported by PHP calling curl in window, if you have encountered such problems, refer.
When I call the Sina Weibo api today (the sdk downloaded from the official website), I found that the image Weibo was not released successfully. 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 you 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 searching.
However, a single sentence in this article reminds me that "the faulty server is Windows and the operating system 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 /.
Take a look at your php version 5.2.5. if something goes wrong, upgrade it quickly.
Not to mention, but I found this again when I wrote an article (I used Weibo api to send Weibo posts with images, prompting that the memory is not enough. this guy is much worse than me, it is estimated that I will not find the problem after I add all the obtained memory, haha). it will not take much effort (unfortunately, this problem has been discovered by me, but it has not 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 I am not dedicated to it, and they are too lazy to upgrade.
For more information about how to solve the memory (curl out of memory) error, see. Calling Sina Micro today...