Home >Backend Development >PHP Tutorial >Two solutions for dedecms unable to download remote images to achieve image localization

Two solutions for dedecms unable to download remote images to achieve image localization

黄舟
黄舟Original
2017-03-31 09:41:042028browse

This article mainly introduces that DreamWeaver dedecms cannot download remote imagespicturesTo achieve image localization solutions, friends who need it can refer to the

dedecms template download address: www.php.cn/xiazai/code/dedecms

The main reason why DEDE image localization fails :
fsockopen() is disabled in the running environment on the serverFunction

Solution 1:

When using fsockopen() Use the stream_socket_client() function instead.

The specific modification place is line 507 of /include/dedehttpdown.class.php

$this->m_fp = @fsockopen($this->m_host, $this->m_port, $errno, $errstr,10);

is replaced with

$this->m_fp = @stream_socket_client($this->m_host . ':' . $this->m_port, $errno, $errstr,10);

##. #Solution 2:

Edit php.ini, find disable_functions, and remove

fsockopen

If the above solution cannot be solved, then analyze Check whether allow_url_fopen in the php.ini

configuration file is turned on;

The above is the detailed content of Two solutions for dedecms unable to download remote images to achieve image localization. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn