dshdb64088 2017-03-08 04:52
浏览 19

需要帮助更改允许在附件表单上传的文件大小

When I try to attach a file to my upload form, it gives me this error:

Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 26990378 bytes)in /home/content/j/o/h/johnmunro/html/upload/include/class.phpmailer.php on line 1238

and here is the line of code on 1238 that is apparently causing this issue. can someone help me.

 /**
* Encodes string to requested format. Returns an
* empty string on failure.
* @access private
* @return string
*/
function EncodeString ($str, $encoding = 'base64') {
$encoded = '';
switch(strtolower($encoding)) {
  case 'base64':
    /* chunk_split is found in PHP >= 3.0.6 */
    $encoded = chunk_split(base64_encode($str), 76, $this->LE);
    break;
  case '7bit':
  case '8bit':
    $encoded = $this->FixEOL($str);
    if (substr($encoded, -(strlen($this->LE))) != $this->LE)
      $encoded .= $this->LE;
    break;
  case 'binary':
    $encoded = $str;
    break;
  case 'quoted-printable':
    $encoded = $this->EncodeQP($str);
    break;
  default:
    $this->SetError($this->Lang('encoding') . $encoding);
    break;
}
return $encoded;

}

  • 写回答

1条回答 默认 最新

  • dsf1222 2017-03-08 04:55
    关注

    The error means that php requires more memory to run.

    To increase allocated memory size to php you have to call : ini_set('memory_limit', '256M'); at the starting of your script(preferably). Replace 256 with the amount of memory you need.

    UPDATE

    You should also work on memory optimization techniques so that php does not require vast amounts of memory to execute.

    Please go through:

    Tips to prevent running out of memory:http://v1.srcnix.com/2010/02/10/7-tips-to-prevent-php-running-out-of-memory/

    PHP memory and performance manual: http://php.net/manual/en/features.gc.performance-considerations.php

    评论

报告相同问题?

悬赏问题

  • ¥15 全部备份安卓app数据包括密码,可以复制到另一手机上运行
  • ¥15 Python3.5 相关代码写作
  • ¥20 测距传感器数据手册i2c
  • ¥15 RPA正常跑,cmd输入cookies跑不出来
  • ¥15 求帮我调试一下freefem代码
  • ¥15 matlab代码解决,怎么运行
  • ¥15 R语言Rstudio突然无法启动
  • ¥15 关于#matlab#的问题:提取2个图像的变量作为另外一个图像像元的移动量,计算新的位置创建新的图像并提取第二个图像的变量到新的图像
  • ¥15 改算法,照着压缩包里边,参考其他代码封装的格式 写到main函数里
  • ¥15 用windows做服务的同志有吗