我已經經歷了很多類似的問題,我無法找到我的問題的答案。SimpleXMLElement在600dpi背景下返回null
我有一個svg image
。我試圖通過使用SimpleXMLElement
從它獲取內容。
$svgimage = path to svg image;
$svgString=file_get_contents($svgimage) ;//returns image
$svg = new SimpleXMLElement($svgString);//returns nothing
我一直在使用300dpi
圖像爲SVG的背景image.Now我改成了600dpi
。之後$svg
回報nothing.I不知道爲什麼的SimpleXMLElement不能在600dpi的工作。
Error Log
Warning: SimpleXMLElement::__construct(): Entity: line 29: parser error : AttValue length too longWarning: SimpleXMLElement::__construct():
xlink:href="data:image/x-ms-bmp;base64,Qk1mDokAAAAAADYAAAAoAAAAZQgAAHEFAAABWarning: SimpleXMLElement::__construct(): Entity: line 29: parser error : attributes construct error
Warning: SimpleXMLElement::__construct(): Entity: line 29: parser error : Couldn't find end of Start Tag image line 20
Warning: SimpleXMLElement::__construct(): Entity: line 709: parser error : internal error: Huge input lookup
Warning: SimpleXMLElement::__construct():
name="order-id"
Size of SVG is 12MB
任何形式的幫助,將不勝感激。
是否有任何錯誤/異常顯示或寫入錯誤日誌? SVG文件有多大?你可能會達到'memory_limit'與600 dpi(只是瘋狂的猜測)。 –
我已更新我的問題。 – NID