我想在我的php代码中使用imagecreatefrompng方法。在调用此方法之前,我已经检查了路径是否引用了一个文件,并且mime类型为image/png,下面是我的监视:

但是当我尝试这个方法$this->image = imagecreatefrompng($bg);时,运行的代码停止了,没有任何异常:
try {
$this->image = imagecreatefrompng($bg);
$this->colour = ImageColorAllocate($this->image, 0, 0, 0); // Black
} catch (Exception $e) {
print_r($e);
} 如何检查错误?
发布于 2017-10-25 12:17:17
这个问题完全是因为我的机器上没有安装gd库。所以我跟随this link安装了它,现在一切都很顺利。
https://stackoverflow.com/questions/46904827
复制相似问题