奶头挺立呻吟高潮av全片,成人试看120秒体验区,性欧美极品v,A片高潮抽搐揉捏奶头视频

php語言

php的常用運行方式是什么

時間:2025-05-03 23:15:06 php語言 我要投稿

php的常用運行方式是什么

  SAPI:Server Application Programming Interface服務(wù)端應(yīng)用編程端口。他就是php與其他應(yīng)用交互的接口,php腳本要執(zhí)行有很多中方式,通過web服務(wù)器,或者直接在命令行行下,也可以嵌入其他程序中。以下是小編為大家搜索整理的PHP常用運行方式是什么,希望能給大家?guī)韼椭?更多精彩內(nèi)容請持續(xù)關(guān)注我們應(yīng)屆畢業(yè)生考試網(wǎng)!

  1、CGI

  CGI即通用網(wǎng)關(guān)接口(common gatewag interface),它是一段程序,通俗的講CGI就象是一座橋,把網(wǎng)頁和WEB服務(wù)器中的執(zhí)行程序連接起來,它把HTML接收的指令傳遞給服務(wù)器的執(zhí) 行程序,再把服務(wù)器執(zhí)行程序的結(jié)果返還給HTML頁。CGI 的跨平臺性能極佳,幾乎可以在任何操作系統(tǒng)上實現(xiàn)。

  CGI方式在遇到連接請求(用戶 請求)先要創(chuàng)建cgi的子進程,激活一個CGI進程,然后處理請求,處理完后結(jié)束這個子進程。這就是fork-and-execute模式。所以用cgi 方式的服務(wù)器有多少連接請求就會有多少cgi子進程,子進程反復(fù)加載是cgi性能低下的主要原因。都會當(dāng)用戶請求數(shù)量非常多時,會大量擠占系統(tǒng)的資源如內(nèi) 存,CPU時間等,造成效能低下。

  2、FastCGI

  fast-cgi 是cgi的升級版本,F(xiàn)astCGI像是一個常駐(long-live)型的CGI,它可以一直執(zhí)行著,只要激活后,不會每次都要花費時間去fork一 次。PHP使用PHP-FPM(FastCGI Process Manager),全稱PHP FastCGI進程管理器進行管理。

  Web Server啟動時載入FastCGI進程管理器(IIS ISAPI或Apache Module)。FastCGI進程管理器自身初始化,啟動多個CGI解釋器進程(可見多個php-cgi)并等待來自Web Server的連接。

  當(dāng)客戶端請求到達Web Server時,F(xiàn)astCGI進程管理器選擇并連接到一個CGI解釋器。Web server將CGI環(huán)境變量和標準輸入發(fā)送到FastCGI子進程php-cgi。

  FastCGI子進程完成處理后將標準輸出和錯誤信息從同一連接返回Web Server。當(dāng)FastCGI子進程關(guān)閉連接時,請求便告處理完成。FastCGI子進程接著等待并處理來自FastCGI進程管理器(運行在Web Server中)的下一個連接。 在CGI模式中,php-cgi在此便退出了。

  在上述情況中,你可以想象CGI通常有多慢。每一個Web 請求PHP都必須重新解析php.ini、重新載入全部擴展并重初始化全部數(shù)據(jù)結(jié)構(gòu)。使用FastCGI,所有這些都只在進程啟動時發(fā)生一次。一個額外的 好處是,持續(xù)數(shù)據(jù)庫連接(Persistent database connection)可以工作。

  3、APACHE2HANDLER

  PHP作為Apache模塊,Apache服務(wù)器在系統(tǒng)啟動后,預(yù)先生成多個進程副本駐留在內(nèi)存中,一旦有請求出 現(xiàn),就立即使用這些空余的子進程進行處理,這樣就不存在生成子進程造成的延遲了。這些服務(wù)器副本在處理完一次HTTP請求之后并不立即退出,而是停留在計算機中等待下次請求。對于客戶瀏覽器的請求反應(yīng)更快,性能較高。

  4、CLI

  cli是php的命令行運行模式,cli端的運行命令有時會很有用,以下總結(jié)幾個:

  查看php版本信息

  5eric:~ youngeric$ php -vPHP 5.5.38 (cli) (built: Oct 1 2016 23:03:00) Copyright (c) 1997-2015 The PHP GroupZend Engine v2.5.0, Copyright (c) 1998-2015 Zend Technologies

  查看當(dāng)前php的擴展

  11eric:~ youngeric$ php -m[PHP Modules]bcmathbz2calendarCorectypecurldate......

  查看php.ini配置信息(相當(dāng)于使用phpinfo()函數(shù))

  14eric:~ youngeric$ php -iniphpinfo()PHP Version => 5.5.38System => Darwin eric.local 16.1.0 Darwin Kernel Version 16.1.0: Wed Oct 19 20:31:56 PDT 2016; root:xnu-3789.21.4~4/RELEASE_X86_64 x86_64Build Date => Oct 1 2016 23:01:51Configure Command => './configure' '--prefix=/usr/local/Cellar/php55/5.5.38_11' '--localstatedir=/usr/local/var' '--sysconfdir=/usr/local/etc/php/5.5' '--with-config-file-path=/usr/local/etc/php/5.5' '--with-config-file-scan-dir=/usr/local/etc/php/5.5/conf.d' '--mandir=/usr/local/Cellar/php55/5.5.38_11/share/man' '--enable-bcmath' '--enable-calendar' '--enable-dba' '--enable-exif' '--enable-ftp' '--enable-gd-native-ttf' '--enable-mbregex' '--enable-mbstring' '--enable-shmop' '--enable-soap' '--enable-sockets' '--enable-sysvmsg' '--enable-sysvsem' '--enable-sysvshm' '--enable-wddx' '--enable-zip' '--with-freetype-dir=/usr/local/opt/freetype' '--with-gd' '--with-gettext=/usr/local/opt/gettext' '--with-iconv-dir=/usr' '--with-icu-dir=/usr/local/opt/icu4c' '--with-jpeg-dir=/usr/local/opt/jpeg' '--with-kerberos=/usr' '--with-libedit' '--with-mhash' '--with-ndbm=/usr' '--with-png-dir=/usr/local/opt/libpng' '--with-xmlrpc' '--with-zlib=/usr' '--with-readline=/usr/local/opt/readline' '--without-gmp' '--without-snmp' '--with-libxml-dir=/usr/local/opt/libxml2' '--with-pdo-odbc=unixODBC,/usr/local/opt/unixodbc' '--with-unixODBC=/usr/local/opt/unixodbc' '--with-bz2=/usr' '--with-openssl=/usr/local/opt/openssl' '--enable-fpm' '--with-fpm-user=_www' '--with-fpm-group=_www' '--with-curl' '--with-xsl=/usr' '--with-ldap' '--with-ldap-sasl=/usr' '--with-mysql-sock=/tmp/mysql.sock' '--with-mysqli=mysqlnd' '--with-mysql=mysqlnd' '--with-pdo-mysql=mysqlnd' '--disable-opcache' '--enable-pcntl' '--without-pear' '--enable-dtrace' '--disable-phpdbg' '--enable-zend-signals'Server API => Command Line InterfaceVirtual Directory Support => disabledConfiguration File (php.ini) Path => /usr/local/etc/php/5.5Loaded Configuration File => /usr/local/etc/php/5.5/php.iniScan this dir for additional .ini files => /usr/local/etc/php/5.5/conf.d......

  查看函數(shù)信息

  8eric:~ youngeric$ php --rf dateFunction [function date ] {- Parameters [2] { Parameter #0 [$format ] Parameter #1 [$timestamp ]}}

  查看類信息

  13eric:~ youngeric$ php --rc pdoClass [class PDO ] {- Constants [89] { Constant [ integer PARAM_BOOL ] { 5 } Constant [ integer PARAM_NULL ] { 0 } Constant [ integer PARAM_INT ] { 1 } Constant [ integer PARAM_STR ] { 2 } Constant [ integer PARAM_LOB ] { 3 } Constant [ integer PARAM_STMT ] { 4 } Constant [ integer PARAM_INPUT_OUTPUT ] { 2147483648 }......

  檢測php代碼

  4eric:~ youngeric$ php -l jiance.phpPHP Parse error: syntax error, unexpected end of file, expecting ',' or ';' in jiance.php on line 3Errors parsing jiance.php

  作為世界上最好的語言,php甚至還內(nèi)置了服務(wù)器的功能(有沒有很震驚的樣子)。

  8eric:Desktop youngeric$ php -S 127.0.0.1:8080PHP 5.5.38 Development Server started at Thu Dec 22 09:44:20 2016Listening on http://127.0.0.1:8080Document root is /Users/youngeric/DesktopPress Ctrl-C to quit.[Thu Dec 22 09:44:29 2016] 127.0.0.1:52988 [404]: / - No such file or directory[Thu Dec 22 09:44:29 2016] 127.0.0.1:52989 [404]: /favicon.ico - No such file

【php的常用運行方式是什么】相關(guān)文章:

php常用運行方式是什么08-15

php的常用運行方式07-23

php的4種常用運行方式詳解06-26

PHP運行于Apache 模塊方式09-24

PHP代碼運行流程08-14

PHP常用MySql操作是什么11-05

PHP處理密碼的方式10-10

PHP底層的運行機制與原理06-20

php是什么11-13

主站蜘蛛池模板: 城市| 深州市| 甘泉县| 太白县| 花垣县| 岳阳市| 沙河市| 信丰县| 河东区| 晋江市| 合江县| 天峻县| 抚松县| 商水县| 麻江县| 吉木乃县| 华蓥市| 平山县| 辽阳市| 黄冈市| 华坪县| 泾川县| 宁河县| 和田县| 绥中县| 阿瓦提县| 化州市| 泊头市| 偏关县| 木兰县| 松江区| 太仓市| 海伦市| 肇东市| 明光市| 江阴市| 奉节县| 惠水县| 彭山县| 从化市| 九江市|