摇头玩儿 發表於 2016-11-3 21:07:14

织梦dedecms不能下载远程图片实现图片本地化解决方法

<p>DEDE图片本地化失效的主要原因:<br />服务器上的运行环境中禁用了fsockopen()函数</p>
<p><strong>解决方案一:</strong></p>
<p>在用fsockopen()的地方用stream_socket_client()函数代替。</p>
<p>具体修改地方是 /include/dedehttpdown.class.php 第507行</p>
<p><font color="#ff0000">$this-&gt;m_fp = @fsockopen($this-&gt;m_host, $this-&gt;m_port, $errno, $errstr,10);</font></p>
<p>替换为</p>
<p><font color="#ff0000">$this-&gt;m_fp = @stream_socket_client($this-&gt;m_host . ':' . $this-&gt;m_port, $errno, $errstr,10);</font></p>
<p><strong>解决方案二:</strong></p>
<p>编辑php.ini,找到disable_functions,把其中的<font color="#ff0000">fsockopen</font>去掉</p>
<p>若上述方案无法解决,那么分析下php.ini配置文件中allow_url_fopen是否是开启状态;</p>
頁: [1]
查看完整版本: 织梦dedecms不能下载远程图片实现图片本地化解决方法