在phpcms根目录创建 : crond 目录。然后创建:create_index php
在phpcms根目录创建 : crond 目录。
然后创建:create_index.php
然后创建:create_index.php
<?php
//15分钟一次,生成首页
# */15 * * * * php /data/wwwroot/www.phpip.com/www/crond/create_index.php
set_time_limit(300);
define('PHPCMS_PATH', substr(dirname(__FILE__),0,-6).DIRECTORY_SEPARATOR);
if(file_exists(PHPCMS_PATH.'../phpcms/base.php')) {
include PHPCMS_PATH.'../phpcms/base.php';
} else {
include PHPCMS_PATH.'phpcms/base.php';
}
$param = pc_base::load_sys_class('param');
$html = pc_base::load_app_class('html','content');
$size = $html->index();
?>
//15分钟一次,生成首页
# */15 * * * * php /data/wwwroot/www.phpip.com/www/crond/create_index.php
set_time_limit(300);
define('PHPCMS_PATH', substr(dirname(__FILE__),0,-6).DIRECTORY_SEPARATOR);
if(file_exists(PHPCMS_PATH.'../phpcms/base.php')) {
include PHPCMS_PATH.'../phpcms/base.php';
} else {
include PHPCMS_PATH.'phpcms/base.php';
}
$param = pc_base::load_sys_class('param');
$html = pc_base::load_app_class('html','content');
$size = $html->index();
?>
linux 下:
crontab -e
*/15 * * * * php /data/wwwroot/www.phpip.com/www/crond/create_index.php
注意:路径自己修改。