cmd run php_PHP tutorial

WBOY
Release: 2016-07-20 11:17:57
Original
1114 people have browsed it

Open command prompt cmd.exe

E:wampbinphpphp5.2.6>php.exe a.php 11

11 is to pass parameters

Obtain

 if($argv[1]){

$_GET['id']=$argv[1];

 }

echo $id=$_GET[id]+1;

You can change a.php to your file name, pay attention to the directory structure

I use a.php directly here because a.php and php.exe are in the same directory

For convenience, you can also add the php installation directory to the environment variable PATH

(Right-click My Computer->Properties->Advanced->Environment Variables, if PATH exists, add your PHP installation directory to the original PATH, if it does not exist, create a new PATH)

After adding it to the environment variable, you don’t need to enter the php installation directory in cmd

Enter php.exe "a.php" (note that "a.php" must be in the directory where your cmd is at this time)

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/371873.htmlTechArticleOpen the command prompt cmd.exe E:wampbinphpphp5.2.6php.exe a.php 11 11 is to pass the parameters to get if($argv[1]){ $_GET['id']=$argv[1]; } echo $id=$_GET[id]+1; You can change a.php to your text...
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 Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!