Cmd run php_PHP tutorial

Source: Internet
Author: User
Run php in cmd. Run the following command to indicate cmd.exe E: wampbinphpphp5.2.6php.exe. php1111 is used to obtain if ($ argv [1]) {$ _ GET [id] $ argv [1];} echo $ id $ _ GET [id] + 1; you can set. change php to your file and open the command prompt cmd.exe

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

11: 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 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 and choose Properties> Advanced> environment variables. If PATH exists, add your PHP installation directory to the original PATH. If PATH does not exist, create a new PATH)

After the environment variable is added, you do not 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 running)

Dig command prompt cmd.exe E: wampbinphpphp5.2.6php.exe. for php 11 11, if ($ argv [1]) {$ _ GET ['id'] = $ argv [1];} echo $ id = $ _ GET [id] + 1; you can set. change php to your document...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.