草庐IT

memory-access

全部标签

php - AWeber API "Method requires access to Subscriber information"错误故障排除

我正在尝试使用PHPSDK从AWeber列表中检索特定订阅者。代码:$subscribers=$account->loadFromUrl("/accounts/$account->id/lists/$list_id/subscribers");var_dump($subscribers->find(array('email'=>$email)));exit;问题是,我收到以下错误:WebServiceError:MethodrequiresaccesstoSubscriberinformation.Google空手而归。 最佳答案

php - 应用程序分析 : Memory Usage

我已经打开了Codeigniter配置文件(非常有用)并且我注意到我的一个页面显示内存用作:2,405,496bytes那是~2MB,而且是一个请求-这是否意味着如果1000个用户同时访问此页面,内存使用量将是2GB?我是不是算错了,或者这不仅仅是两个数字相乘?感谢大家的帮助编辑对于运行2个简单选择查询的脚本来说,这种内存使用是否正常?我会自动加载帮助程序,例如表单、url以及数据库和session类。 最佳答案 2MB并不算多——至少我觉得这并不奇怪;在使用框架时,我经常看到更高的值,即使没有执行大量SQL查询也是如此。请注意me

PHP [面向对象] : Memory allocation for Inheritance

请看下面的代码:classA{publicx=5;publicy=6;publicz=7;}classBextendsA{publicm=1;publicn=2;}$a=newA();$b=newB()从上面的代码可以看出,$a正在分配x内存量,而$b正在分配y内存量;现在我的问题是下面哪一个是正确的?x>yx 最佳答案 这些是我的数字:Startingallocation62480AllocatedmemoryfornewA()328AllocatedmemoryfornewB()496因此x这两个类定义是等价的classBext

php - 如何在没有 access_token 的情况下显示来 self 网站的 facebook 提要消息?

我有一个facebook站点(站点,而不是个人资料墙),并且想在网页上显示消息提要。如果我使用,这已经可以正常工作了https://graph.facebook.com/177610425663218/feed但是为此我需要一个access_token。使用GraphExplorer我可以生成一个临时token。我知道我可以创建一个OAuth,但我不希望我网页的每个访问者都登录facebook只是为了查看提要。必须有另一种方式...也许使用PHP而不是Javascript? 最佳答案 https://developers.faceb

PHP fatal error : Allowed memory size of 268435456 bytes exhausted on NormalizerFormatter. php 第 62 行

我正在尝试通过doctrine2在mysql中插入大约20000条记录foreach($getIdsas$id){//20000Ids$twNode=newTwNode();$twNode->setTwId($id);$twNode->addAcFriend($this->twAccount);$this->twAccount->addFollower($twNode);$this->em->persist($twNode);$this->em->persist($this->twAccount);$this->em->flush();$this->output->write('W')

php - PHP类函数中的 fatal error "Cannot access empty property"在哪里?

这段代码有什么问题?$db_host='localhost';$this->$db_user='root';$this->$db_name='input_oop';$this->$db_table='users';}functionuserInput($f_name,$l_name){$dbc=mysql_connect($this->db_host,$this->db_user,"")ordie("Cannotconnecttodatabase:".mysql_error());mysql_select_db($this->db_name)ordie(mysql_error());$

php - 使用 readfile 时为 "Allowed memory .. exhausted"

我用PHP制作了一个下载脚本,该脚本一直运行到昨天。今天我试图下载其中一个文件,却发现它突然停止工作了:PHPFatalerror:Allowedmemorysizeof67108864bytesexhausted(triedtoallocate119767041bytes)inE:\home\tecnoponta\web\aluno\download.phponline52出于某种原因,PHP试图在内存中分配文件的大小,我不知道为什么。如果文件大小小于内存限制,我可以毫无问题地下载它,问题是文件更大。我知道可以通过增加php.ini中的内存限制或什至在代码中使用ini_set来纠正它

php - Facebook : OAuthException: (#200) Must have a valid access_token to access this endpoint

我正在尝试从facebook获取所有公共(public)事件,当我尝试从我的服务器执行我的php代码时,出现错误:UncaughtOAuthException:(#200)Musthaveavalidaccess_tokentoaccessthisendpointthrowin/....../sdk/src/base_facebook.php第1254行如果我在heroku上执行相同的代码......它工作......我想在我的服务器上执行代码......请帮助......我的代码是......:'.........','secret'=>'..............','share

php - NuSOAP varDump PHP fatal error : Allowed memory size of 134217728 bytes exhausted

对不起我的英语:)我有NuSOAP0.9.5版。我在尝试获取大数据时遇到了php错误:PHPfatalerror:允许的134217728字节内存已耗尽(已尝试分配27255652字节)堆栈跟踪显示问题出在varDump方法中。我的解决方案是:我已将varDump方法(在nusoap.php中)更改为:functionvarDump($data){$ret_val="";if($this->debugLevel>0){ob_start();var_dump($data);$ret_val=ob_get_contents();ob_end_clean();}return$ret_val;

php - 静态变量和函数 : memory allocation in php

我对php5.3脚本的内存分配有疑问。假设您有2个静态类(MyData和Test),如下所示:classMyData{privatestatic$data=null;publicstaticfunctiongetData(){if(self::$data==null)self::$data=array(1,2,3,4,5,);returnself::$data;}}classTest{privatestatic$test_data=null;publicstaticfunctiongetTestData1(){if(self::$test_data==null){self::$test