Home  >  Article  >  CMS Tutorial  >  What should I do if DEDECMS5.5 cannot collect data under a foreign Linux host?

What should I do if DEDECMS5.5 cannot collect data under a foreign Linux host?

藏色散人
藏色散人Original
2019-12-24 10:03:381580browse

What should I do if DEDECMS5.5 cannot collect data under a foreign Linux host?

What should I do if DEDECMS5.5 cannot collect data on a foreign Linux host?

I have been playing with dedecms again recently to see how powerful the function of dedecms5.5 is. So I uploaded it to my Dreamhost host and started running it with a temporary domain name. After playing with it, I found that I couldn't collect it, and even the remote pictures and resources for downloading articles published by DEDE couldn't be used. Weird.

Recommended study: 梦Weavercms

Then I remembered that I had seen an article before saying that Dreamhost’s host disabled allow_url_fopen, resulting in the inability to collect. So I searched and searched on the Internet and found several articles in which I compiled PHP myself to allow Dreamhost to support collection. So I followed the introduction on the official website of Dreamhost, and through SSH, I finally finished compiling my own php after struggling for a long time. I happily ran to the system to collect it, but it still failed. Upload a probe and see that allow_url_fopen is indeed enabled, which is strange. I continued to Google, and repeated tests later proved that Dreamhost actually enabled allow_url_fopen by default. The articles introduced on the Internet were basically articles from 2008 or before, so Dreamhost must have figured out how to release this restriction.

After struggling for two days, I didn’t believe it. I uploaded multiple Supesite and php168, and the installation and collection were completed in one go. You darling, it turns out that dede couldn't collect it himself. Wondered. After searching the dede official website, I also found that some netizens also reported that they could not collect data on foreign Linux hosts. Ever since, I finally found a solution, which is just to change a file. I forgot where I read the article where I originally found the solution. It's just a modified file on this machine. I would like to thank that guy.

The problematic file is in the include/dedehttpdown.class.php file. After covering it with the attachment provided in this article, you can use the collection function smoothly and use "Download" when publishing articles. Remote pictures and resources" function. After comparing this file, it was found that two places had been modified.

1. Comment out the code on line 280, as follows:

The code is as follows:

// fputs($this->m_fp, $headString);

2. Find the code on line 304, and replace it with the following code:

The code is as follows:

$headString .= "Connection: Close\r\n\r\n"; 
//fputs($this->m_fp,"Connection: Close\r\n\r\n");

3. Find the code on line 308 and replace it with the following code:

The code is as follows:

$headString .= "\r\n"; 
//fputs($this->m_fp,"\r\n");

4. The code on line 315" //Get response header status information" insert the following code above:

The code is as follows:

fputs($this->m_fp, $headString);

The above is the detailed content of What should I do if DEDECMS5.5 cannot collect data under a foreign Linux host?. 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