 1                   .       World Wide Web (WWW).          ,      .             ,  .     , ,       web-. ,      ,     ,        .          ,       ,    ,       . ,        ,         .  ,           Linux/UNIX  Windows      HTML.        ,         . ,  ,       .     ,         , -    .          1995 ,   -     (Rasmus Lerdorf)   Perl/CGI     ,    .     :         web-.  WWW   ,         ,        .      ,  Personal Home Page ()  Hypertext Processor ( ).             .     ,    HTML,   ,       .    ,        Perl  .         2.0,  PHP-FI (Personal Home Page  Form Interpretator).    2.0      .        ,      .          HTML      ,      3.0.     3.0  1997   50 000       web-.    1997   ,       Personal Home page,   Hypertext Processor           .      ,     .   1999   Netcraft (http://www.netcraft.com)   , ,   ,     1 000 000,             .    1999        4.0.          ,     ,        .            ,     Zend (http://www.zend.com).      22  2000     4.0.     Zend,  Zend Technologies ()   Zend,          Zend.  ,           40  100 %.       Zend.      ,   Netcraft (http://www.netcraft.com),         3,6  .    ,         web-,      .              Web,        web-.          ,           ,     Perl, Java  C++.        ,     , -        .     ,    ,    web- (  HTML),            ,     JavaScript, , WML (Wireless Markup Language)    .            ,      .           ,  ,       ,  XML (Extensible Markup Language), ODBC (Open Database Connectivity)  Macromedia Shockwave.              ,           .          ,      HTML-,             HTML.  HTML       .      :   <html>  <title><? print "Hello world!"; ?></title>  </html>   "Hello world!"    web-.  ,   print  ,       (<?...?>),    .    ,          ,     !   ,              .         /Apache  .       ,    ,       .       ,      .     .       , ,  ,        .            .       :  ;  ;  ;  ;  .      ,     :   !         ,    .       Perl,        ,        Pascal.        .          10 000            .     ,      -   .           (<?)      ,       (?>).     ,     ,   .              ,      WWW.   4.0          - ,     .         (reference counting),    .                ,      :       .            ,    ;           .         (safe mode),          . ,         (       ).    cgi-bin       ,         ,            (,  passwd).                  .        ,           (e-commerce).     ,         ,         .          ,         View Source.      ,     .           16.         (embedded) ,         .         HTML,         JavaScript, WML, XML   .  ,          (,       ).         ,           .  ,        ,   ,   ,    ,      PC. ,  - ,       .       ,    web-,      (,   ). Apache, Microsoft IIS, Netscape Enterprise Server, Stronghold  Zeus       .       ,     --      ,  UNIX, Solaris, FreeBSD  Windows 95/98/NT.   ,        ,   Enterprise Java Beans  - Win32.                    .       Open Source      .             ,     Linux,     Apache     Open Source.       ,              .     Open Source          . ,          ,             .               web-.    ,       .                       .      - ,   MySQL,         .  ,    MySQL      ,      .     ,  MySQL    ,      ,       !      (Michael Monty Widenius),    MySQL   http://www.mysql.com       mp3.lycos.com    .              .          0  1,4    ,      .     ,    :           - ,     ,       .     (Stig Bakken),   FAST Search & Transfer ASA   http://www.fast.no        ,    PHP/FI 1.x.  ,               .        .          .        web-,  32bit.com  DevShed.com.      Info West    ,      .                   .   ,           ,        .           web-    . , ,   ,     .     (Randy Cosby),    nGenuity, Inc. DevShed   http://www.devshed.com      ,    1.1,  ,      HTML-.    1.1.       <?   //       $site_title = " Recipes";   $bg_color = "white";   $user_name = "Chef Luigi";   ?>   <html>   <head>   <title><? print $site_title; ?></title>   </head>   <body bgcolor="<? print $bg color; ?>" >   <?   //       . print "    Recipes | ".dateC'F d. Y")." <br> Greetings, $user_name! <br>   ";   ?>   </body>   </html>    . 1.1  ,       .    . 1.1.       , ?  ,        .      ,          .     .    /Apache     ,       ,      web-   .      web-,  ,    Apache  -,    web-   , -,      . ,       web-   .                   .         http://www.php.net.         :    Win32;   .     Win32    Windows 95/98/ NT/2000.         Windows,     . ,      (,      ),    Visual C++    .       http://www.php.net/ version4/win32build.php.    Win32     .           .        ,      . ,  ,      RPM (RedHat Package Manager)? , ,         .              .     .      http://www.php.net      ,      .        .  ,    .       .             4.0.3. ,    ,     .        .        Apache,       .     http://www.apache.org/dist/binaries,      .  ,   .          web-     ,       Apache.   ,  web-   ,     ,  ,         ,    .            .        ,      .     ,          Win32    .            MySQL,           web-   .     ,     MySQL (http://www.mysql.com). MySQL,   ,     Windows    .    MySQL     , ,       11,         MySQL.      ,          Apache.      .  ,    Windows,   :   CGI,   Apache    Apache.  ,          CGI.  ,         ,            .         ,             Apache,  ,          ,  .       Windows         CGI,    Apache.         CGI,    Windows    Apache  web- (, Microsoft Internet Information Server  Microsoft Personal Web Server). CGI-     .       /Apache,     web-    .     , 4   web-,    AOL Server, Netscape Enterprise Server, Microsoft IIS, Zeus   . ,       Apache.     ,      ,       http://www.php.net.  ,     Windows    ,    ,     .      :    :   gunzip apache_1.3.9.tar.gz   gunzip php-4.0.0.tar.gz          *.tar.      :   tar -zxvf apache_1.3.x.tar   tar -zxvf php-4.0.x.tar         .    Apache        Apache   .      :     Apache:   cd apache_1.3.x  Apache.     ,  ,        :   ./configure -prefix=[]    ; ,    .  -with-config-file-path  ,       .       /usr/local/lib,         :   ./configure -with-apache=../apache_1.3.x -with-config-file-path=[]  make  make install     Apache.     ,    Apache.  -other-configuration-options      ,      web- Apache.      .       Apache:   ./configure -activate-module=src/modules/php4/libphp4.a  -other-configuration-options  make  make install        Apache httpd.conf.     Apache,    ,       web-.    :   ServerName new.host.name       :   ServerName localhost        #AddType application/x-httpd-php .php .php4  #AddType application/x-httpd-php-source .php .phps          ,    .       (#)    .           .   Apache  :   ./bin/apachectl start  Voila! PHP  Apache   .         phpinfo.php     Apache   htdocs,     Apache:   <?   php info();  ?>       .         .        Apache.     Apache      ,         web-. Apache             ModuleRewrite  ModuleSpelling.      ,           , . ,      /    ,         web-.    :     Apache:   cd apache_1.3.x  Apache.     ,  ,        .  -other-configuration-options      ,      web- Apache.      .       Apache.   ./configure -prefix=[] -enable-module=so -other-configuration-options   Apache.    make     :   make   Apache.    make install      .         :   make install      ,      httpd.conf.      conf ,    2.           ServerName new.host.name       :   ServerName local host     ,    . ,    .      ,   apxs,   bin ,        2:   ./configure -with-apxs=[/k/apxs]   make   make install    Apache httpd.conf   .                   ,      Apache, httpd.conf.   ,      ;        .   httpd.conf    .        :   #AddType application/x-httpd-php .php .php4  #AddType application/x-httpd-php-source .php .phps         ,    .    '  (#)    .             ( cd).  Apache  :   ./bin/apachectl start   Voila!   Apache   .           phpinfo.php     Apache   htdocs,     Apache:   <?   php_info():   ?>        .         .         Apache.     Windows 95/98/NT    -        Windows, ,       .     ,        .        Apache       Windows.       Apache.   ,         (wizard) .        .           (C:\Program Files\Apache Group\Apache). ,      C:\Apache   .      ,         (Start).         .      .   Typical ( ).      ,  .      httpd.conf,    conf ,    2.         ServerAdmin yourname@yoursite.com   yourname@yoursite.com  .      (  ,   localhost):  ServerName localhost   Apache    ,    .     ,     .      Windows NT,     (Start)  Install Apache as Service (NT Only).    ,    (Services),  Apache      (Start). Apache          .   ,   ,    http: /local host/.        ,     .      .   ,    ,      .    ,      ,      php.ini-dist.    php.ini     C:\Windows.          , php4ts.dll  Mscvrt.dll.      C:\Windows\System\. ,  Mscvrt.dll         ,  .     Apache http.conf      .     .     ScriptAlias /cgi-bin/ "C:/Apache/cgi-bin/"       :   ScriptAlias /php4/ "C:/php4/"    AddType.     :   #AddType application/x-httpd-php3. phtml  #AddType application/x-httpd-php3-source .phps       :   AddType application/x-httpd-php .phtml .php   AddType application/x-httpd-php-source .phps         :   #  # Action lets you define media types that will execute a script whenever  # a matching file is called. This eliminates the need for repeated URL  # pathnames for oft-used CGI file processors.  # Format: Action media/type /cgi-script/location  # Format: Action handler-name /cgi-script/location   #       :   Action application/x-httpd-php /php4/php.exe   Apache   .           phpinfo.php     Apache   htdocs.     ,      2:   <?   php_info();  ?>      ,  ,    web-    ,    ,   web-    World Wide Web.          Apache (http://www.apache.org).  ,        , ,      ,      .        л.                 .            ,   ,      ,       .       php.ini,       /usr/local/lib/   .       web-,     ,  php.ini     ,      .     ,       .   php.ini    .     3.0    php3.ini,    4.0     php.ini. 
                ,          .        .   short_open_tag [on | off]    short_open_tab [on | off]      <?...?>    .   asp_tags [on | off]   asp_tags [on | off]       ASP    .      ASP      :   <%  print "This is  code.";  %>  precision [integer]   precision [integer]    ,    .   safe_mode [on | off]       ,       .    ,                 ,  passwd   Linux.  safe_mode    CGI- .          16.   max_execution_time [integer]   max_execution_time [integer]        .        ,  .   error_reporting [1-8]   error_reporting [1-8]        .   ,      .   	 	 1 	 	 2 	  	 4	   	 8	 	  display_errors [on | off]   display_errors[on | off]       .   log_errors   log_errors ,      .    log_errors ,    ,     error_log.   error_log [filename]   error_log  ,        log_errors.   magic_quotes_gpc     magic_quotes_gpc   ,       ,     . ,  g  get/post/cookie.     ,   magic_quotes_gpc        .      ,      .   magic_quotes_gpc   ,        ;        .   track_vars    track_vars       ,    $HTTP_GET_VARS[], $HTTP_POST_VARS[], $HTTP_POST_FILES, $HTTP_COOKIE_VARS[], $HTTP_ENV_VARS[]  $HTTP_SERVER_VARS[].       13.   ,       .     ,     .       .             ,    ,     ,   .           -       .       л (escaping to ).       :   ;   ;   script;    ASP.             ,        :   <?php print "Welcome to the world of PHP!": ?>         :    <?   php,     .           ,  JavaScript,    .  ,     ?>,    .               :   <? print "Welcome to the world of PHP!"; ?>        ,    .     :    -enable-short-tags   ;    short_open_tag   php.ini.    script           HTML (    ),     web-.     script:   <script language="php">  <?php print "Welcome to the world of PHP!"; ?>  </script>     ASP              ASP (Active Server Page).     ,  ,        (%):   <%php print "Welcome to the world of PHP!"; %>      ASP   ,    .         print    (=),         ASP,        :   <%=$variable %>              <%  //    $recipe  $recipe = "Lasagna":  %>  Luigi's favorite recipe is <%=$recipe;%>        .     $recipe   "Lasagna". ,     $i,         ASP. ,        (<?...?>).    HTML          HTML          , HTML  JavaScript (.  1.2).    1.2.   HTML    <html>  <head>  <title>Basic PHP/HTML integration</title>  </head>  <body>  <?  //      HTML   print.  print "<h3>PHP/HTML integration is cool.</h3>";  ?>  </body>  </html>    . 1.2.       date()    1.2 ,   HTML     .            (<h3>...</h3>).            HTML.     1.3      web-         (. 1.2).    1.3.     <title>PHP Recipes | <? print (date("F d, Y")); ?></title>     date()       .      .         HTML        ,   .   1.4         (h3)  $big_font       .    1.4.   HTML  <html>  <head>  <title>PHP Recipes | <? print (date("F d, Y")); ?></title>  </head>  <?  $big_font = "h3";  ?>  <body>  <? print "<$big_font>PHP Recipes</$big_font>"; ?>  </body>  </html>   1.4     1.3       (<h3>...</h3>)   ,        print.            HTML.               web-        ( 1.5).    1.5.         <html>   <head>   <title>   <?   print "Another PHP-enabled page";   Svariable = "Hello World!";   ?>   </title></head>   <body>   <? print Svariable; ?>   </body>   </html>    1.5    (  )    HTML.     ,         ,          .                 .      :          ,    .               .                   .     .              .     ,       .           (//),        (#).     :   <?  //    $rose_color = "red";  #    $violet_color = "blue";  print "Roses are $rose_color, violets are $violet_color"  ?>  ,           ,     :   <?  // : example. php  // : ..  // : 24  2000 .  print "An example with comments";  ?>            ,   .               /*  */.   <?   /* 
 : multi_coramment_example.php 
  :      
 : .. 
 : 14  2000 .   */  print "A multiline comment can be found at the top of this script!";  ?>   ,                .             :     ;    ;    ;    .          ,           .          ,    .          ,        web-.        web-  Recipes.