Home > php教程 > php手册 > body text

windows下如何实现在命令行下运行PHP文件

WBOY
Release: 2016-06-21 08:49:12
Original
2096 people have browsed it

在linux中做定时脚本的时候经常会用crontab命令去定时执行php文件,其实在windows环境下面也可以用命令行去执行php文件的,下面就看看如何来实现的吧。

(1)配置系统变量path的值。将你的php程序的执行程序php.exe文件所在的路径加入到系统变量的path中去(注意不要把path中已存在的字符串给改了,各个值之间的分隔符号用分号,如下图所示),如下图:

(2)按以上配置完毕就可以了,以后就可以直接在dos窗口界面按如下命令直接运行php脚本文件了:

php D:\PHPnow-1.5.6\htdocs\test.php



Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template