2016-01-23 184 views
-2

我该如何去从终端窗口运行脚本@http://www.domain.com/php/script.php/。另外,我需要传递一个变量,$var1 = "string"。我将如何做到这一点?从终端运行远程php脚本

+0

Curl或wget或许 – 2016-01-23 08:24:57

回答

2

您可以使用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&param2=bar > /dev/null