WordPress plugin cos-HTML-Cache cannot generate static files

Source: Internet
Author: User

Cos-HTML-Cache plug-ins are very practical. In particular, the usage of the Multi-Blog traffic is relatively large, WP generation of static pages can greatly reduce the burden on servers, this article describes how to use the plug-in and how to generate static files.
Next, let's take a look at the problem. I use a Linux virtual host and bind a second-level domain name, which means that the website directory is not in the Web root directory. After the PHP environment is installed in Windows XP, the CoS-HTML-Cache plug-in is tested normally, but it is not available on the virtual host. Cos-HTML-Chace only generates the home page, Article Static files are not generated.
First of all, declare that the permissions of all WordPress folders are set to 777. The following is the solution of the author:
Permanent connection path:/html/javaspost_id+.html put all static files in the/html website folder
If the homepage can be generated normally, but the static file of the article cannot be generated, the biggest reason is that the HTML folder is not 777 and has no write permission, or the path obtained by the plug-in is incorrect, this is the case because it is a virtual host. I cannot generate it because the path is incorrect.
After studying the plug-in source code cos-html-cache.php, the author found that the $ PATH variable is the physical path of the website in the virtual host, but the obtained is different from the actual, this leads to directory errors, HTML files under the website cannot be found at all, so static pages cannot be generated.
The plug-in uses $ Path = $ _ server ['document _ root'] to obtain the file. The author then creates a test AA. php file under the root directory of the website, and then writes it:
<? PHP
Echo dirname (_ file __);
?>
Enter http: // website address/AA. php In the browser and press Enter.
Output:/home/yy1880/public_html/blog/AA. php
You can obtain the physical location of your website on the VM through the output, that is,/home/yy1880/public_html/blog/
Then change the $ Path = $ _ server ['document _ root'] in the plug-in source code cos-html-cache.php to $ Path = "/home/yy1880/public_html/blog.
In this way, everything is ready. log on and visit the blog for testing.

 

Note: This article is from the Internet.

 

 

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.