Weaving dream dedecms Unable to download remote pictures workaround for fsockopen function disabled

Source: Internet
Author: User

On the Linux server, the Fsockopen () function is ruthlessly disabled (this is actually for security reasons, understandable), the ability to download remote pictures is no way to use. After finding some information, the solution is to replace the Fsockopen () function with the stream_socket_client () function. The specific method is as follows:

Open the dedehttpdown.class.php file in/include/and find the following code:

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

Replace with:

$this stream_socket_client ("". $this->m_host. ":". $this $errno $errstr, 10);

Save, then upload, and you can.

The collection of Atlas also needs to be changed, the location of the change is:

Open the dedecollection.func.php file in/include/and find the following code:

$m _FP Fsockopen ($ghost$errno$errstr, 10);

Change to the following:

$m _FP stream_socket_client ("". $ghost $errno $errstr, 10);

Find:

$m _FP Fsockopen ($ghost$errno$errstrdie ($ghost. ') <br/> ');

Change to the following code:

$m _FP stream_socket_client ("". $ghost $errno $errstr  die ($ghost. ' <br/> ');

Can.

Weaving dream dedecms Unable to download remote pictures workaround for fsockopen function disabled

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.