This article mainly introduces how dedecms can not download remote images to implement image localization, the need of friends can refer to the next article mainly introduced the dream dedecms can not download remote # css/css-rwd-images.html "target =" _ blank "> Image localization solution, for more information, see
Dedecms Template: www.php1.cn/xiazai/code/dedecms
The main cause of DEDE Image localization failure:
The fsockopen () function is disabled in the running environment on the server.
Solution 1:
Use the stream_socket_client () function in place of fsockopen.
The specific modification is/include/dedehttpdown. class. php row 507th.
$ This-> m_fp = @ fsockopen ($ this-> m_host, $ this-> m_port, $ errno, $ errstr, 10 );
Replace
$ 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 from it.
If the preceding solution cannot be solved, check whether allow_url_fopen in the php. ini configuration file is enabled;
The above is the details of the two solutions to achieve Image localization without downloading remote images in dedecms. For more information, see other related articles in the first PHP community!