简体   繁体   中英

execute a remote server php script from a windows batch file on command line

I have a php script on my hosted linux/unix server.I want to create a CLI for windows/linux both for executing my PHP script. for linux i can create a shell script that can execute my php script by using methods like url,curl). But how can i execute php script from a windows CLI (batch file). If any good suggestion for Linux CLI would be appreciated.

Thanks, Pankaj

You can download sh.exe (Bash) for win32 which will let you run the same script on both platforms. On windows then you only need to do sh.exe script.sh

I use this method all the time because BAT programming is such a futile and terrible exercise in time-wasting.

http://unxutils.sourceforge.net/

EDIT: Oh wait, I thought you were trying to run a PHP script on a website (ie, via wget). I'm not sure what the implications of running PHP as CLI on win32 are.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM