内存耗尽 Allowed memory bytes exhausted

浏览:873 发布日期:2017/04/22 分类:ThinkPHP5专区
[1] ErrorException in Image.php line 82
Allowed memory size of 268435456 bytes exhausted (tried to allocate 167359296 bytes)
            'mime'   => $info['mime'],
        ];

        //打开图像
        if ('gif' == $this->info['type']) {
            $this->gif = new Gif($file->getPathname());
            $this->im  = @imagecreatefromstring($this->gif->image());
        } else {
            $fun      = "imagecreatefrom{$this->info['type']}";
            $this->im = @$fun($file->getPathname());
        }

        if (empty($this->im)) {
            throw new ImageException('Failed to create image resources!');
        }

    }

    /**
图片处理类总是报错内存耗尽,memory_limit=256了,请大神赐教其他有效解决办法
谢谢!
最佳答案
评论( 相关
后面还有条评论,点击查看>>