2013-01-06 63 views
0

我有一台运行centOS的主机。我的网站是基于Magento,它是现场直播。测试在windows/wamp上运行cron作业的magento模块

我创建了一个每分钟运行一次cron作业的模块。

我的问题是:我在windows上运行我的本地主机(wampserver 2.0)。在我的模块上载实时主机之前,我想在本地主机上测试它。是否有可能在Windows上测试我的cron作业运行模块?

回答

6

通过说你的模块“运行”一个cron作业,你可能意思是说增加了一个cron作业。为了测试它,你不需要在你的windows本地主机上运行一个cron。您可以通过从Magento安装的根目录运行cron.php来手动触发所有Magneto cron作业。你可以从这样的浏览器中这样做http://localhost/magento_dir/cron.php

0

您可以使用schtasks.exe创建一个新的计划任务,以根据需要运行。

schtasks /create /sc minute /mo 1 /tn "Cron" /tr "php -f C:\wamp\www\pro\run.php" 

您可以找到有关命令的详细信息,并在我的博客的链接下方的使用。

http://purusothaman.me/computers/running-cron-in-windows/

0

如果使用Windows 2008及更高版本进入管理MMC和配置下访问任务调度。对于1.8法师必须在你的陈述中加上-mdefault 1。 cron文件中有更改。

1

Magento的2.0.2 打开命令提示符

cd c:\xampp\htdocs\magento202\bin 
php magento cron:run 
php magento cron:run 
cd C:\xampp\htdocs\magento202\update 
php cron.php 
cd c:\xampp\htdocs\magento202\bin 
php magento setup:cron:run 

与你更换目录 'magento202'

0

“你可以从这样http://localhost/magento_dir/cron.php浏览器做”>你会得到Acces拒绝 - >去编辑.htaccess和注释行

########################################### 
## Deny access to cron.php 
## <Files cron.php> 

############################################ 
## uncomment next lines to enable cron access with base HTTP authorization 
## http://httpd.apache.org/docs/2.2/howto/auth.html 
## 
## Warning: .htpasswd file should be placed somewhere not accessible from the web. 
## This is so that folks cannot download the password file. 
## For example, if your documents are served out of /usr/local/apache/htdocs 
## you might want to put the password file(s) in /usr/local/apache/. 
#AuthName "Cron auth" 
#AuthUserFile ../.htpasswd 
#AuthType basic 
#Require valid-user 
############################################ 
##  Order allow,deny 
## Deny from all 
##</Files>