Several php code execution methods using phpclisapi

Source: Internet
Author: User
Tags php cli
1. php-rphpcodesparam1param22.php-ffilename.phpparam1param23.php-a4. In the php file header with php file full path such as file. php! # Usrbinphp? Phpechophpinfo (); then, add the execution permission chmod + xfile. php. file. php to file. php to execute

1. php-r php codes param1 param2 2. php-f filename. php param1 param2 3. php-a 4. Add the full php file path to the php file header, such as file. php! #/Usr/bin/php? Phpecho phpinfo (); then, add the execution permission chmod + x file. php./file. php to file. php.

1. php-r 'php Code' param1 param2...
2. php-f filename. php param1 param2...
3. php-
4. Add the full PHP file path to the PHP File Header
For example, file. php

! #/Usr/bin/php

 

Then add the execution permission chmod + x file. php to file. php.
./File. php can execute the php code in the file.

Original article address: several ways to execute php code using php cli sapi. Thank you for sharing with me.

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.