从终端运行远程php脚本
问题描述:
我该如何去从终端窗口运行脚本@http://www.domain.com/php/script.php/
。另外,我需要传递一个变量,$var1 = "string"
。我将如何做到这一点?从终端运行远程php脚本
答
您可以使用curl或wget来运行这些脚本,例如,
curl --silent http://www.domain.com/php/script.php > /dev/null
至于参数,你可以将它们作为$ _GET参数,可以如
curl --silent http://www.domain.com/php/script.php?param1=foo¶m2=bar > /dev/null
Curl或wget或许 – 2016-01-23 08:24:57