Php SAPI, CLISAPI, CGISAPI-php tutorial

Source: Internet
Author: User
Tags sapi
Php SAPI, CLISAPI, CGISAPI, php SAPI, cli sapi, CGI SAPI

Http://www.cnblogs.com/yjf512/p/3482040.html

First, run php-r 'echo 12; 'in the command line ;'

The console prints 12;

Isn't this a wonderful process? I entered shell commands, but executed php scripts. After the php script is executed, the output can also be output on the console.

There must be an interface between this shell command (Console Command) and php to convert shell parameters, code, and so on to php, then convert the php output to the shell output. This Interface is called the SAPI (Server Application Programimg Interface ). It is equivalent to the proxy of the PHP external environment.

So because PHP can be applied to terminals or Web servers, SAPI of applications on terminals is called cli sapi, the application in the Web server is called cgi sapi. After installing php in windows, you will see two sdks: php.exeand php-cgi.exe. For example, if you use php-v on the console, you will find that the PHP version information has a (cli) identifier, which means that your php application uses cli SAPI.

About cli sapi: The manual has a very detailed description: http://php.net/manual/zh/features.commandline.php

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.