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

黄舟
Release: 2023-03-07 08:04:02
Original
1997 people have browsed it

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);
Copy after login

is replaced with

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

##. #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!

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template