php ImageMagick 扩展错误: cache resources exhausted /xxxpath/xxxpath @ error/cache.c/OpenPixelCache/4083
问题解决步骤:
错误表示内存资源耗尽,需要修改扩展的配置。
vi /etc/ImageMagick-6/policy.xml
change <policy domain="resource" name="memory" value="256MiB"/> to <policy domain="resource" name="memory" value="1GiB"/>
甚至可以直接将限制去除(注释):
<!-- <policy domain="resource" name="temporary-path" value="/tmp"/> -->
<!-- <policy domain="resource" name="memory" value="2GiB"/> -->
<!-- <policy domain="resource" name="map" value="4GiB"/> -->
<!-- <policy domain="resource" name="area" value="1GB"/> -->
<!-- <policy domain="resource" name="disk" value="16EB"/> -->
<!-- <policy domain="resource" name="file" value="768"/> -->
<!-- <policy domain="resource" name="thread" value="4"/> -->
<!-- <policy domain="resource" name="throttle" value="0"/> -->
<!-- <policy domain="resource" name="time" value="3600"/> -->
<!-- <policy domain="system" name="precision" value="6"/> -->