Detailed concept and the main configuration file php

Browser only able to decode the document in HTML format , for non- HTML document format , browser plug-ins or by calling CGI call other APIs to decode .

Dynamic Website : We on the server side or client-side implementation of a script or a program , the results of the implementation of this program under a different user, client, perform scene is different!

          Dynamic site must be able to make a response corresponding to the request according to a user, it returns the contents of even different for different users, according to customer requester, returning

          The result is not the same.

Dynamic website is divided into client and server-side dynamic dynamic

                 Client News: Our server-side source code to be downloaded to the local, and performed locally, and the execution results are displayed through a browser.

               Server-side dynamic: the implementation of the source code inside the server, and the implementation of the results returned to the client browser.

mysql.i686-PHP -> This package is PHP to access MySQL driver  

 

When PHP3.0 , introduced zend engine, our implementation process is divided into two sections

      The first paragraph: lexical analysis, parsing, convert opcode

      Second stage: execution of opcode (placed in memory )

In order to avoid his own to clear opcode, opcode and shared among a number of different processes, sharing opcode function, introduced Cache Accelerator!

 

    Cache Accelerator:

          APC

          eAccelerator

          XCache

php interpreter and mysql interactive

    Truly interactive and mysql is using php interpreter developed program ( php program)

   

<HTML>     -> HTML tag

   <head>      -> header

     <title> </ title>  -> title ( on the title page )

   </head>

         <Bady>   -> body (body comprising web page content)

    

    

         </bady>

  </html>

 

 

 

/etc/httpd/conf/httpd.conf

1, find the module, confirm that Apache supports CGI

 

2, find this option ScriptAlias / cgi-bin / "/ var / www / cgi-bin /"  for CGI scripts is scheduled to be executed in which directory which

                          Access path to the directory

3, and then in the / var / www / cgi-bin / create a script in this directory

   

 

Apache support DSO mechanism

DSO: Dynamic Shared Object

 

php interpreter and httpd interacts ()

 

Install a: FastCGI PHP server itself can generate idle process in advance, these idle process by the PHP server self-management, front-end Apache need to use PHP time function

         PHP server to initiate a direct request on it, PHP server assigns an idle process to Apache , if Apache request is over, the process still or back, the pin needs

         Server will destroy themselves when destroyed. A server based on a similar mechanism as a client, Apache for the client, PHP server to server.

         The default listening on port 9000

After that comes with Red Hat 5.4 on this function, the name fpm (Rapid PHP module ) ,

 

Apache and PHP combination of three ways:

          CGI

          module (simple)

          fastCGI (configuration trouble)

 

 

 

如何配置Apache服务器使用PHP功能?

1、PHP安装包

php-5.3.3-22.el6.i686.rpm   -->不支持fpm,需要使用这个功能需要打补丁

2、php配置文件(Apache基于线程或进程工作时,他们所依赖的PHP模块也是不一样的 )

 

<IfModule prefork.c>    -->基于进程工作

   LoadModule php5_module modules/libphp5.so   -->在进程模式下PHPPHP以传统意义上的方式工作

</IfModule>

 

<IfModule worker.c>   -->基于线程工作

   LoadModule php5_module modules/libphp5-zts.so -->在线程模式下,PHP必须以zts的方式工作

</IfModule>

不管是哪一种,他会判断你使用哪个模式,并相应加载合适的模块

AddHandler  php5-script .php -->处理器,以.php结尾的文件,就是用这个工具来处理

AddType  text/html .php   -->添加了一种类别text/html

DirectoryIndex  index.php    -->默认主页面

 

PHP程序的主配置文件(/etc/php.ini

[名字]      -->一个[名字]只对这一堆指令生效(分段式配置)

一大堆指令

[名字]

一大堆指令

Guess you like

Origin www.cnblogs.com/linux-s/p/11288657.html