【发布时间】:2010-11-16 23:27:14
【问题描述】:
有人可以帮我把这段代码翻译成 PHP 4 吗?
try
{
$picture = PDF_open_image_file($PDF, "jpeg", $imgFile, "", 0); // This is the original statement, this works on PHP4
}
catch(Exception $ex)
{
$msg = "Error opening $imgFile for Product $row['Identifier']";
throw new Exception($msg);
}
基本上,当出现致命错误时,我需要获取 $row['Identifier'] 以便知道导致错误的产品。
提前致谢。
编辑:我不知道 PHP_open_image_file 做了什么,但有时我会收到如下错误,我需要获取导致错误的产品标识符。
致命错误:PDFlib 错误 [1016] PDF_open_image_file:无法打开 JPEG 文件 'picture/b01_le1x.jpg' 用于 正在读取(未找到文件) /var/www/html/catalogue/pdf_make.php 在第 618 行
【问题讨论】:
-
为什么还在用 PHP4?
-
+1 这个东西的服务器还在用 PHP4 =.="
-
我的哀悼。如果
PDF_open_image_file抛出异常,它甚至会在 PHP4 中按原样运行吗?似乎你必须重新设计整个东西。 -
大声谢谢!我已经更新了问题
-
告诉你的主机不要烂,更新到 PHP5
标签: php error-handling php4