{"id":365625,"date":"2024-05-21T02:42:11","date_gmt":"2024-05-21T02:42:11","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=365625"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=365625","title":{"rendered":"<span>PHP\/FI 1. Personal Home Page Tools\/Forms Interpreter<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e24\/10d\/008\/e2410d008b56f06c1d96e6149ec40d46.webp\" alt=\"\u041f\u0443\u0442\u044c \u043e\u0442 \u043d\u0430\u0431\u043e\u0440\u0430 CGI-\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u0434\u043e \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u044f\u0437\u044b\u043a\u043e\u0432 \u0432\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438\" title=\"\u041f\u0443\u0442\u044c \u043e\u0442 \u043d\u0430\u0431\u043e\u0440\u0430 CGI-\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u0434\u043e \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u044f\u0437\u044b\u043a\u043e\u0432 \u0432\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438\" width=\"450\" height=\"139\"\/><\/p>\n<div><figcaption>\u041f\u0443\u0442\u044c \u043e\u0442 \u043d\u0430\u0431\u043e\u0440\u0430 CGI-\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u0434\u043e \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u044f\u0437\u044b\u043a\u043e\u0432 \u0432\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438<\/figcaption><\/div>\n<\/figure>\n<h2>\u0418\u0441\u0442\u043e\u0440\u0438\u044f \u0437\u0430\u0440\u043e\u0436\u0434\u0435\u043d\u0438\u044f PHP <\/h2>\n<p>\u0418\u0441\u0442\u043e\u0440\u0438\u044f PHP \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u043d\u0435 \u0441 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u043e\u0433\u043e \u044f\u0437\u044b\u043a\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0430 \u0441 \u043d\u0430\u0431\u043e\u0440\u0430 CGI-\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u043d\u0430 C, \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e\u0433\u043e \u043a\u0430\u043a PHP\/FI 1 (Personal Home Page Tools\/Forms Interpreter). \u041f\u043e\u0437\u0436\u0435, \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0435\u043a\u0442 \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u043b\u0441\u044f \u0432 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432, \u0430\u043a\u0440\u043e\u043d\u0438\u043c PHP \u0441\u0442\u0430\u043b \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043a\u0430\u043a Hypertext Preprocessor. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u0441\u044f \u043a \u0438\u0441\u0442\u043e\u043a\u0430\u043c PHP, \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u044f \u0435\u0433\u043e \u043f\u0435\u0440\u0432\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e, \u0435\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044e \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c.<\/p>\n<p>\u0410\u0432\u0442\u043e\u0440\u043e\u043c PHP \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0420\u0430\u0441\u043c\u0443\u0441 \u041b\u0435\u0440\u0434\u043e\u0440\u0444, \u0441\u043e\u0437\u0434\u0430\u0432\u0448\u0438\u0439 \u0438 \u0432\u044b\u043b\u043e\u0436\u0438\u0432\u0448\u0438\u0439 \u0432 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f PHP\/FI 1 \u0432 \u0438\u044e\u043d\u0435 1995 \u0433\u043e\u0434\u0430. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043e\u043d \u0438 \u043d\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u043b, \u043a\u0430\u043a\u043e\u0435 \u0432\u043b\u0438\u044f\u043d\u0438\u0435 \u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442 \u043e\u043a\u0430\u0436\u0435\u0442 \u043d\u0430 \u043c\u0438\u0440 \u0432\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438. \u0412 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043d\u0435 \u0431\u044b\u043b\u043e \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u0441\u0438\u0441\u0442\u0435\u043c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u0432\u0435\u0440\u0441\u0438\u0439 \u0438 \u0445\u043e\u0441\u0442\u0438\u043d\u0433\u043e\u0432 IT-\u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432. \u0414\u043e \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044f git \u043e\u0441\u0442\u0430\u0432\u0430\u043b\u043e\u0441\u044c 10 \u043b\u0435\u0442, \u0438 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044f \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u0433\u043e \u041f\u041e \u043d\u0435 \u0431\u044b\u043b\u0430 \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0430 \u0432 \u0442\u043e\u043c \u0432\u0438\u0434\u0435, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043c\u044b \u0435\u0435 \u0437\u043d\u0430\u0435\u043c \u0441\u0435\u0439\u0447\u0430\u0441. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0434\u043b\u044f \u0435\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043b\u043e. \u0412\u043f\u0435\u0440\u0432\u044b\u0435 \u0430\u0432\u0442\u043e\u0440 PHP \u0430\u043d\u043e\u043d\u0441\u0438\u0440\u043e\u0432\u0430\u043b \u0441\u0432\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 \u0440\u0430\u0441\u0441\u044b\u043b\u043a\u0438 <em><abbr class=\"habraabbr\" title=\"https:\/\/en.wikipedia.org\/wiki\/Usene -\u00a0\u043f\u0440\u0430\u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0444\u043e\u0440\u0443\u043c\u043e\u0432, \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0441 1980 \u0433\u043e\u0434\u0430\" data-title=\"&lt;p>&lt;a href=&quot;https:\/\/en.wikipedia.org\/wiki\/Usenet&quot;>https:\/\/en.wikipedia.org\/wiki\/Usene&lt;\/a>&amp;nbsp;-&amp;nbsp;\u043f\u0440\u0430\u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0444\u043e\u0440\u0443\u043c\u043e\u0432, \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0441 1980 \u0433\u043e\u0434\u0430&lt;\/p>&#187; data-abbr=&#187;Comp.lang.Newsgroups&#187;>Comp.lang.Newsgroups<\/abbr><\/em>, \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u043d\u043e\u0439 \u0432\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435.<\/p>\n<p>\u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0435\u043a\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u043b\u0441\u044f \u0434\u043b\u044f \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u043d\u0443\u0436\u0434 \u0441 \u0446\u0435\u043b\u044c\u044e \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043b\u0438\u0447\u043d\u044b\u043c \u0432\u0435\u0431-\u0441\u0430\u0439\u0442\u043e\u043c \u0430\u0432\u0442\u043e\u0440\u0430, \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c \u043f\u043e\u0441\u0435\u0449\u0430\u0435\u043c\u043e\u0441\u0442\u044c, \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f\u043e\u043c \u043a \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0443, \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0432\u0435\u0431-\u0444\u043e\u0440\u043c, \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b.<\/p>\n<h2>\u0421\u0431\u043e\u0440\u043a\u0430 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a PHP\/FI 1 \u0441\u043f\u0443\u0441\u0442\u044f \u043f\u043e\u0447\u0442\u0438 30 \u043b\u0435\u0442<\/h2>\n<p>\u0412\u0441\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 PHP, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0441\u0430\u043c\u044b\u0435 \u0440\u0430\u043d\u043d\u0438\u0435, \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 <a href=\"https:\/\/museum.php.net\/\" rel=\"noopener noreferrer nofollow\"><u>Museum of PHP<\/u><\/a>.<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043a\u0430\u0447\u0430\u0435\u043c \u0441\u0430\u043c\u0443\u044e \u043f\u0435\u0440\u0432\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u0438 \u0440\u0430\u0441\u043f\u0430\u043a\u0443\u0435\u043c \u0430\u0440\u0445\u0438\u0432:<\/p>\n<pre><code class=\"bash\">wget https:\/\/museum.php.net\/php1\/php-108.tar.gz -P php1 cd php1 tar -xzvf php-108.tar.gz -C .<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a\u0438\u0435 \u0444\u0430\u0439\u043b\u044b \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u0441\u044f \u0432 \u0430\u0440\u0445\u0438\u0432\u0435:<\/p>\n<details class=\"spoiler\">\n<summary>\u0421\u043f\u0438\u0441\u043e\u043a \u0444\u0430\u0439\u043b\u043e\u0432:<\/summary>\n<div class=\"spoiler__content\">\n<p> php\/phpf.c<br \/> php\/phpl.c<br \/> php\/phplview.c<br \/> php\/phplmon.c<br \/> php\/common.c<br \/> php\/error.c<br \/> php\/post.c<br \/> php\/wm.c<br \/> php\/common.h<br \/> php\/config.h<br \/> php\/subvar.c<br \/> php\/html_common.h<br \/> php\/post.h<br \/> php\/version.h<br \/> php\/wm.h<br \/> php\/Makefile<br \/> php\/README<br \/> php\/License<\/p>\n<\/div>\n<\/details>\n<p>\u0425\u043e\u0442\u044c \u0444\u0430\u0439\u043b\u043e\u0432 \u0438 \u043d\u0435\u043c\u043d\u043e\u0433\u043e, \u043d\u043e \u0435\u0441\u0442\u044c README. \u041e\u0434\u043d\u0430\u043a\u043e \u0435\u0433\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435 \u0441\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443:<\/p>\n<ol>\n<li>\n<p>\u041e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0439\u0442\u0435 \u0444\u0430\u0439\u043b\u044b <code>config.h<\/code> \u0438 <code>Makefile<\/code> \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u0432\u0430\u0448\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439<\/p>\n<\/li>\n<li>\n<p>\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0443: <code>make<\/code><\/p>\n<\/li>\n<li>\n<p>\u0421\u043a\u043e\u043f\u0438\u0440\u0443\u0439\u0442\u0435 CGI-\u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u0432 \u0432\u0430\u0448\u0443 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e CGI. \u0414\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0430 \u0441\u0430\u0439\u0442\u043e\u0432, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0445 NCSA HTTPD, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0430\u0437\u0432\u0430\u0442\u044c \u0438\u0445 filename.cgi \u0438 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432 \u0432\u0430\u0448\u0443 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e ~\/public_html.  <\/p>\n<\/li>\n<li>\n<p>\u042f \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u044d\u0442\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u043f\u043e\u0434 \u0432\u0430\u0448\u0438\u043c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u0430 \u043d\u0435 \u043f\u043e\u0434 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f httpd.   <\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 <a href=\"http:\/\/www.io.org\/~rasmus\" rel=\"noopener noreferrer nofollow\">http:\/\/www.io.org\/~rasmus<\/a> \u0434\u043b\u044f \u043f\u043e\u043b\u043d\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439 \u043f\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435. (\u0414\u0430, \u044f \u043b\u0435\u043d\u0438\u0432. \u041c\u043d\u0435 \u043d\u0435 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u043f\u0438\u0441\u0430\u0442\u044c \u0432\u0441\u0451 \u0434\u0432\u0430\u0436\u0434\u044b.) <\/p>\n<\/li>\n<li>\n<p>E\u0441\u043b\u0438 \u0445\u043e\u0442\u0438\u0442\u0435, \u043f\u043e\u0434\u043f\u0438\u0448\u0438\u0442\u0435\u0441\u044c \u043d\u0430 \u0441\u043f\u0438\u0441\u043e\u043a \u0440\u0430\u0441\u0441\u044b\u043b\u043a\u0438 PHP, \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0432 \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u043e\u0435 \u043f\u0438\u0441\u044c\u043c\u043e \u043d\u0430 \u0430\u0434\u0440\u0435\u0441:<br \/><code>majordomo@kajen.malmo.se<\/code><br \/>\u0441\u043e \u0441\u0442\u0440\u043e\u043a\u043e\u0439:<br \/><code>subscribe php-list <\/code>your_email_address<br \/>\u0432 \u0442\u0435\u043b\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f. <\/p>\n<\/li>\n<\/ol>\n<p>\u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u0441\u0430\u0439\u0442\u0430 <a href=\"http:\/\/www.io.org\/~rasmus\" rel=\"noopener noreferrer nofollow\"><u>http:\/\/www.io.org\/~rasmus<\/u><\/a> \u0443\u0436\u0435 \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442, \u043d\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f\u043c \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442.<\/p>\n<p>\u0412 \u0444\u0430\u0439\u043b\u0435 config.h \u0435\u0441\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u044b \u043f\u0440\u0435\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430:<\/p>\n<pre><code class=\"cpp\">#define ROOTDIR \"~\/html\" \/\/ \u043a\u043e\u0440\u043d\u0435\u0432\u0430\u044f \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f #define HTML_DIR \".\" \/\/ \u043f\u0430\u043f\u043a\u0430 \u0441 html \u0444\u0430\u0439\u043b\u0430\u043c\u0438 #define LOGDIR \".\" \/\/ \u043f\u0430\u043f\u043a\u0430 \u0434\u043b\u044f \u043b\u043e\u0433-\u0444\u0430\u0439\u043b\u043e\u0432 #define ACCDIR \".\" \/\/ \u043f\u0430\u043f\u043a\u0430 \u0441 \u0444\u0430\u0439\u043b\u0430\u043c\u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 #define NOACCESS \"NoAccess.html\" \/\/ \u0444\u0430\u0439\u043b \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430<\/code><\/pre>\n<p>\u0412 Makefile \u043f\u0440\u043e\u0441\u0442\u043e \u0443\u043a\u0430\u0436\u0435\u043c \u0441\u0431\u043e\u0440\u043a\u0443 \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u043e\u0442\u043b\u0430\u0434\u043a\u0438 \u0438 \u0434\u0435\u0431\u0430\u0433-\u043c\u043e\u0434 \u0434\u043b\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430:<\/p>\n<pre><code class=\"cmake\">... # Generic compiler options CFLAGS= -g -O2 -Wall -DDEBUG $(OPTIONS) #CFLAGS =-O2 $(OPTIONS) ...<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <code>make<\/code> \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442 4 CGI \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b:<\/p>\n<pre><code class=\"bash\">make ... ls | grep \".cgi\" phpf.cgi phpl.cgi phplmon.cgi phplview.cgi<\/code><\/pre>\n<p>\u041d\u0430 \u0434\u0430\u043d\u043d\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e, \u0437\u0430 \u0447\u0442\u043e \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u043a\u0430\u0436\u0434\u0430\u044f \u0438\u0437 \u043d\u0438\u0445. \u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f CGI \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440. \u0412 1995 \u0433\u043e\u0434\u0443 \u0441\u0430\u043c\u044b\u043c \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u043c \u0431\u044b\u043b NCSA HTTPd, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432 \u0442\u043e\u043c \u0436\u0435 \u0433\u043e\u0434\u0443 \u0441\u0442\u0430\u043b \u043e\u0441\u043d\u043e\u0432\u043e\u0439 \u0434\u043b\u044f Apache HTTP Server. \u041e\u0434\u043d\u0430\u043a\u043e, \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e CGI \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043d\u0430 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u043c PHP.<\/p>\n<h2>CGI \u0412\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440 \u0434\u043b\u044f PHP\/FI \u043d\u0430 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u043c PHP<\/h2>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0441\u043f\u0440\u0430\u0432\u043a\u0430 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 CGI. CGI (Common Gateway Interface) \u2014 \u044d\u0442\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u043d\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0432\u043d\u0435\u0448\u043d\u0438\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430\u043c \u0438\u043b\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u0430\u043c, \u0430 \u0437\u0430\u0442\u0435\u043c \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e. \u042d\u0442\u043e \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446 \u0438 \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0435 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c. \u0414\u0430\u043d\u043d\u044b\u0439 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442 \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 1990-\u0445 \u0438 \u0431\u044b\u043b \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u0435\u043d \u0434\u043e \u043d\u0430\u0447\u0430\u043b\u0430 2000-\u0445 \u0433\u043e\u0434\u043e\u0432.<\/p>\n<p><strong>\u0411\u0430\u0437\u043e\u0432\u0430\u044f \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f CGI:<\/strong>  <\/p>\n<ul>\n<li>\n<p><strong>\u041c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0417\u0430\u043f\u0440\u043e\u0441\u0430<\/strong>: \u0412\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u0435\u0442 CGI-\u0441\u043a\u0440\u0438\u043f\u0442\u044b \u043b\u0438\u0431\u043e \u043f\u043e \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u043c\u0443 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0443 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <code>\/cgi-bin\/<\/code>), \u043b\u0438\u0431\u043e \u043f\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044e \u0444\u0430\u0439\u043b\u0430 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <code>.cgi<\/code> \u0438\u043b\u0438 <code>.pl<\/code>). \u041a\u043e\u0433\u0434\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0442\u0430\u043a\u043e\u0439 \u0440\u0435\u0441\u0443\u0440\u0441, \u043e\u043d \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0441\u043a\u0440\u0438\u043f\u0442 \u0432\u043c\u0435\u0441\u0442\u043e \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0444\u0430\u0439\u043b \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0443.<\/p>\n<\/li>\n<li>\n<p><strong>\u041f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u0414\u0430\u043d\u043d\u044b\u0445<\/strong>: \u0414\u0430\u043d\u043d\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u0443 \u0447\u0435\u0440\u0435\u0437 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0441\u0440\u0435\u0434\u044b (environment variables) \u0438 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0432\u0432\u043e\u0434 (stdin), \u0430 \u0432\u044b\u0432\u043e\u0434 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 (stdout) \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u0443, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0435\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e.<\/p>\n<\/li>\n<li>\n<p><strong>\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0437\u0430\u043f\u0440\u043e\u0441\u0430:<\/strong> CGI-\u0441\u043a\u0440\u0438\u043f\u0442\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u044e\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0435 \u0447\u0435\u0440\u0435\u0437 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0441\u0440\u0435\u0434\u044b. \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0437 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445:<\/p>\n<ul>\n<li>\n<p><code>QUERY_STRING<\/code>: \u0441\u0442\u0440\u043e\u043a\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u0430\u044f \u0432 URL \u043f\u043e\u0441\u043b\u0435 \u0437\u043d\u0430\u043a\u0430 <code>?<\/code>.<\/p>\n<\/li>\n<li>\n<p><code>REQUEST_METHOD<\/code>: \u043c\u0435\u0442\u043e\u0434 HTTP \u0437\u0430\u043f\u0440\u043e\u0441\u0430 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <code>GET<\/code> \u0438\u043b\u0438 <code>POST<\/code>).<\/p>\n<\/li>\n<li>\n<p><code>CONTENT_TYPE<\/code> \u0438 <code>CONTENT_LENGTH<\/code>: \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0442\u0435\u043b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u0430\u044f \u0434\u043b\u044f \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0442\u0438\u043f\u0430 POST.<\/p>\n<\/li>\n<li>\n<p><code>SCRIPT_NAME<\/code> \u0438 <code>PATH_INFO<\/code>: \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0442\u043e\u043c, \u043a\u0430\u043a\u043e\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u0431\u044b\u043b \u0432\u044b\u0437\u0432\u0430\u043d, \u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0443\u0442\u044c, \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442\u0443.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<ul>\n<li>\n<p><strong>\u0412\u0432\u043e\u0434<\/strong>: \u0414\u043b\u044f \u043c\u0435\u0442\u043e\u0434\u0430 <code>GET<\/code>, \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 <code>QUERY_STRING<\/code>. \u0414\u043b\u044f <code>POST<\/code> \u2014 \u0434\u0430\u043d\u043d\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0447\u0438\u0442\u0430\u044e\u0442\u0441\u044f \u0438\u0437 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e \u0432\u0432\u043e\u0434\u0430.<\/p>\n<\/li>\n<li>\n<p><strong>\u0412\u044b\u0432\u043e\u0434<\/strong>: CGI-\u0441\u043a\u0440\u0438\u043f\u0442 \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438 \u043e\u0442\u0432\u0435\u0442\u0430 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <code>Content-Type<\/code>), \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043f\u0443\u0441\u0442\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430, \u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0442\u043e\u043c \u0442\u0435\u043b\u043e \u043e\u0442\u0432\u0435\u0442\u0430.<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043b\u044e\u0441\u044b \u0442\u0430\u043a\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u044e\u0442\u0441\u044f \u0432 \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u0435: \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0432\u043d\u0435\u0448\u043d\u044e\u044e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u0438 \u043e\u0442\u0434\u0430\u0435\u0442 \u043a\u043b\u0438\u0435\u043d\u0442\u0443 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043a\u0430\u043a \u0435\u0441\u0442\u044c, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0435 \u0432\u0430\u0436\u043d\u043e \u043d\u0430 \u043a\u0430\u043a\u043e\u043c \u044f\u0437\u044b\u043a\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d CGI \u0441\u043a\u0440\u0438\u043f\u0442.<\/p>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u043c \u043c\u0438\u043d\u0443\u0441\u043e\u043c \u0436\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u0447\u0442\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0435\u043c\u043a\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0435\u0439.<\/p>\n<p><strong>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043d\u0430 PHP<\/strong><\/p>\n<p>\u0412\u0441\u044f \u043e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u043b\u043e\u0433\u0438\u043a\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0431\u0443\u0434\u0435\u0442 \u0441\u0442\u0440\u043e\u0438\u0442\u044c\u0441\u044f \u0432\u043e\u043a\u0440\u0443\u0433 \u0444\u0443\u043d\u043a\u0446\u0438\u0438<a href=\"https:\/\/www.php.net\/manual\/ru\/function.proc-open.php\" rel=\"noopener noreferrer nofollow\"> <u>proc_open<\/u><\/a>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0432\u043d\u0435\u0448\u043d\u044e\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443, \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u044f \u0435\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0441\u0440\u0435\u0434\u044b, \u0438 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u044b \u0432\u0432\u043e\u0434\u0430\/\u0432\u044b\u0432\u043e\u0434\u0430.<\/p>\n<pre><code class=\"php\">&lt;?php  $port = 8080; $address = '127.0.0.1';  \/**  * \u041f\u0430\u0440\u0441\u0438\u043c \u0437\u0430\u043f\u0440\u043e\u0441 \u0438 \u0434\u043e\u0441\u0442\u0430\u0435\u043c \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b  * @param $request  * @return array  *\/ function parseRequest($request): array {     $request = explode(\"\\r\\n\\r\\n\", $request);     $headers = explode(\"\\r\\n\", $request[0]);     $body = $request[1] ?? '';     $headerLine = array_shift($headers);     preg_match('\/(GET|POST) (\\\/\\S*) HTTP\\\/1.\\d\/', $headerLine, $matches);     $method = strtolower($matches[1]) ?? '';     $path = $matches[2] ?? '';     $queryParams = parse_url($path);     return [         'method' => $method,         'path' => $queryParams['path'] ?? '',         'query' => $queryParams['query'] ?? '',         'body' => $body,     ]; }  \/** \u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u0432\u044b\u0437\u043e\u0432 cgi \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u043e\u0442\u0432\u0435\u0442\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0443  * @param $client  * @param $request  * @return void  *\/ function handleRequest($client, $request) {     $method = $request['method'];     $path = $request['path'];     $query = $request['query'];     $body = $request['body'];      \/\/ \u041f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u043c \u0442\u043e\u043b\u044c\u043a\u043e get \u0438 post \u0437\u0430\u043f\u0440\u043e\u0441\u044b     if (!in_array($method, ['get', 'post'])) {         echo \"Error: Invalid method\\n\";         socket_write($client, \"HTTP\/1.1 405 Method Not Allowed\\r\\n\\r\\n\");         return;     }      \/\/ \u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0441\u0440\u0435\u0434\u044b \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u043b\u044f PHP\/FI 1     $env = [         'REQUEST_METHOD' => strtoupper($method),         'QUERY_STRING' => $query,         'CONTENT_TYPE' => 'application\/x-www-form-urlencoded',         'CONTENT_LENGTH' => strlen($body)     ];      \/\/ \u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430     $cmd = \".\" . $path;     $params = str_replace('+', ' ', $query);      \/\/ \u0414\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u044b \u0432\u0432\u043e\u0434\u0430 \u0432\u044b\u0432\u043e\u0434\u0430     $descriptors = [         0 => ['pipe', 'r'], \/\/ stdin         1 => ['pipe', 'w'], \/\/ stdout         2 => ['pipe', 'w'], \/\/ stderr     ];      \/\/ \u0417\u0430\u043f\u0443\u0441\u043a \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430     $process = proc_open($cmd . ' ' . $params, $descriptors, $pipes, '.', $env);     if (is_resource($process)) {         \/\/ \u0417\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0442\u0435\u043b\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0432 stdin         if($body) {             fwrite($pipes[0], $body);         }         fclose($pipes[0]);          $output = stream_get_contents($pipes[1]);         $errors = stream_get_contents($pipes[2]);         if($errors){             var_dump($errors);         }          fclose($pipes[1]);         fclose($pipes[2]);          proc_close($process);          \/\/ \u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u043a\u043b\u0438\u0435\u043d\u0442\u0443 \u043e\u0442\u0432\u0435\u0442         $statusCode = strpos($output, 'Location:') !== false ? '302 Found' : '200 OK';         $response = \"HTTP\/1.1 {$statusCode}\\r\\n{$output}\";         socket_write($client, $response);     } }  $socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); socket_set_option($socket, SOL_SOCKET, SO_REUSEADDR, 1); socket_bind($socket, $address, $port); socket_listen($socket);  echo \"\u0421\u0435\u0440\u0432\u0435\u0440 \u0437\u0430\u043f\u0443\u0449\u0435\u043d http:\/\/$address:$port\\n\";  while (true) {     $client = socket_accept($socket);     $request = socket_read($client, 1024);     $parsedRequest = parseRequest($request);      handleRequest($client, $parsedRequest);      socket_close($client); }  socket_close($socket);  ?> <\/code><\/pre>\n<p>GET-\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b PHP\/FI 1 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043d\u0435 \u0447\u0435\u0440\u0435\u0437 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0441\u0440\u0435\u0434\u044b QUERY_STRING, \u0430 \u043a\u0430\u043a \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b.<\/p>\n<h2>\u0410\u043d\u0430\u043b\u0438\u0437 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430<\/h2>\n<p><strong>phpl.cgi<\/strong><\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/1d6\/84d\/174\/1d684d1743fcf35b567bbc3c58921273.png\" alt=\"\u0414\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 phpl.cgi\" title=\"\u0414\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 phpl.cgi\" width=\"624\" height=\"190\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/1d6\/84d\/174\/1d684d1743fcf35b567bbc3c58921273.png\"\/><\/p>\n<div><figcaption>\u0414\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 phpl.cgi<\/figcaption><\/div>\n<\/figure>\n<p>phpl.cgi \u00a0&#8212; \u043e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433\u043e\u043c html \u0441\u0442\u0440\u0430\u043d\u0438\u0446, \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0435\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435\u043c \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438 \u043f\u043e\u0441\u0435\u0449\u0435\u043d\u0438\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446. \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0438\u0449\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0448\u0435\u043d\u043d\u044b\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u044b\u043b \u0443\u043a\u0430\u0437\u0430\u043d \u0432 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0435 HTML_DIR \u0444\u0430\u0439\u043b\u0430 config.h, \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0444\u0430\u0439\u043b\u0430 All.acc \u0438\u043b\u0438 \u043e\u0434\u043d\u043e\u0438\u043c\u0435\u043d\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0448\u0435\u043d\u043d\u043e\u043c\u0443 \u0444\u0430\u0439\u043b\u0443 \u0441 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435\u043c .acc, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f index.html \u044d\u0442\u043e index.acc. All.acc \u0438\u043c\u0435\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0438\u0439 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442, \u0438 \u0435\u0433\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043d\u0435 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442\u0441\u044f \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0444\u0430\u0439\u043b\u0430\u043c\u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430.<\/p>\n<p>\u0424\u043e\u0440\u043c\u0430\u0442 \u0444\u0430\u0439\u043b\u0430 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u0442 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 .htaccess \u0438\u0437 Apache, \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0438 \u0435\u0433\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u043e \u043c\u0430\u0441\u043a\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0441\u043e\u0431\u043b\u044e\u0434\u0430\u0435\u0442\u0441\u044f \u043b\u0438 \u0434\u0430\u043d\u043d\u043e\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e. \u041a\u043e\u0434 \u044d\u0442\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0441\u043b\u043e\u0436\u0435\u043d \u0434\u043b\u044f \u0432\u043e\u0441\u043f\u0440\u0438\u044f\u0442\u0438\u044f, \u043e \u0447\u0435\u043c \u0434\u0430\u0436\u0435 \u0443\u043a\u0430\u0437\u0430\u043b \u0441\u0430\u043c \u0430\u0432\u0442\u043e\u0440 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445:<\/p>\n<pre><code class=\"cpp\">\/*  * wild_match has been borrowed from eggdrop 0.9m  * by Robey Pointer &lt;robey@annwfn.indstate.edu>  *  * I've just fixed up the prototype and whitespace to be  * more readable. -Ben Eng &lt;ben@achilles.net>  *\/ \/*  * Yanked out C++ comments -Rasmus Lerdorf &lt;rasmus@io.org>  *\/  \/* brand new reg.c -- this one seems to get a fairly consistant 10%    gain over the old one.  i ripped off the one from IRC servers and    edited it to make it work a little better (allows better quoting,    and returns a number indicating how closely the string matched,    just like the old one).   *\/   #include &lt;stdio.h> #include &lt;sys\/types.h>  #define tolower(c) \\ ( ( ( ( c ) >= 'A' ) &amp;&amp; ( ( c ) &lt;= 'Z' ) ) ? ( ( c ) - 'A' + 'a' ) : c )  \/* this is the matches( ) function from ircd, spaghetti'd up to be more    effecient on masks that don't end with a wildcard ( ie: hostmask matches ).    first it does a quick scan of the string in reverse, aborting quickly    if any non-wildcard characters don't match.  once it comes to the first    wildcard, it falls into the reverse-engineered ( by fred1 ) matches    function.  it's proven to be pretty durn fast.  thanks to justin slootsky,    who came up with the original idea of running the matches backward ( in    slightly more complex form ).    i tried to put lots of comments, cos string matching is not my thing,    and i had to sit and think for 5 minutes for every line. ( ugh! ) *\/ int wild_match( const char *ma, const char *na  ) { const char *mask = ma, *nask = na, *m = ma, *n = na, *mlast; int close = 0, q = 0, wild = 0;  \/* take care of null strings ( should never match ) *\/ if( ( ma == (char *)0 ) || ( na == (char *)0 ) ) return 0;  if( ( !*ma ) || ( !*na ) ) return 0; \/* find the end of each string *\/ while( *m ) m++; while( *n ) n++; m--; n--; mlast = m;  \/* check the match backwards *\/ \/* while:    chars are identical OR the mask char is an unquoted '?'        &amp; haven't reached the start of either string        &amp; mask char isn't an unquoted '*'    *\/ while( ( ( tolower( *m ) == tolower( *n ) ) || ( ( *m == '?' ) &amp;&amp; ( m[ -1 ] != '\\\\' ) ) ) &amp;&amp; ( m != ma ) &amp;&amp; ( n != na ) &amp;&amp; !( ( *m == '*' ) &amp;&amp; ( m[ -1 ] != '\\\\' ) ) ) { if( !( ( *m == '?' ) &amp;&amp; ( m[ -1 ] != '\\\\' ) ) ) close++; \/* 1 more exact match *\/ m--; n--; if( *m == '\\\\' ) m--; \/* if mask was quoting something, skip the \\ *\/ }  if( ( *m  !=  '*' ) || ( *( m - 1 ) == '\\\\' ) ) { \/* case II - entire string matched, there were no '*' *\/ if( ( m == ma ) &amp;&amp; ( n == na ) &amp;&amp; ( tolower( *m ) == tolower( *n ) ) ) return close+1; \/* case III - one of the strings ended prematurely ( no match ) *\/ if( ( m == ma ) || ( n == na ) ) return 0; \/* case IV - failed to match the ending strings, so abort *\/ return 0; } \/* else *\/  \/* case I - hit an unquoted '*' -- fall into matching algorithm *\/ while( 1 ) { q = ( m > mask ) ? ( *( m - 1 ) == '\\\\' ) : 0;  \/* quoted? *\/ if( m &lt; mask ) { if( n &lt; nask ) return close + 1; \/* Made it through both strings! *\/ for( m++; ( m &lt; mlast ) ? ( *m == '?' ) : 0; m++ ) ;  \/* skip ?s *\/ if( ( *m == '*' ) &amp;&amp; ( m &lt; mlast ) ) return close + 1; if( wild ) { m = ma; n = --na; } else return 0; } else if( n &lt; nask ) { while( ( *m == '*' ) &amp;&amp; ( m >= mask ) ) m--; return ( m &lt; mask ) ? close+1 : 0; } q = ( m > mask ) ? ( *( m - 1 ) == '\\\\' ) : 0; \/* quoted? *\/ if( ( *m == '*' ) &amp;&amp; ( !q ) ) { \/* unquoted '*' ? *\/ while( ( m > mask ) ? ( *m == '*' ) : 0 ) m--;  \/* Throw away the *s *\/ if( *m == '\\\\' ) { m++; q = 1; }  \/* First non-* was quoted, so keep it *\/ wild = 1; ma = m; na = n; } if( ( tolower( *m )  !=  tolower( *n ) ) &amp;&amp; ( ( *m  !=  '?' ) || q ) ) { \/* non-match *\/ if( wild ) { m = ma; n = --na; q=( m > mask ) ? ( *( m - 1 ) == '\\\\' ) : 0;  \/* quoted? *\/ } else return 0; } else { if( ( *m != '?' ) || q ) close++; \/* Unquoted ?s aren't counted *\/ if( *m ) m--; \/* This char got matched *\/ if( *n ) n--; \/* This char got matched *\/ if( q ) m--; \/* This quote went with the char we matched *\/ } } }<\/code><\/pre>\n<p>\u0412\u043e\u0442 \u043a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442:<\/p>\n<ol>\n<li>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u044e\u0442\u0441\u044f \u0441\u043b\u0443\u0447\u0430\u0438, \u043a\u043e\u0433\u0434\u0430 \u043e\u0434\u043d\u0430 \u0438\u0437 \u0441\u0442\u0440\u043e\u043a \u0438\u043b\u0438 \u043e\u0431\u0435 \u043f\u0443\u0441\u0442\u044b\u0435 (\u043d\u0435 \u043c\u043e\u0433\u0443\u0442 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0442\u044c).<\/p>\n<\/li>\n<li>\n<p>\u0411\u044b\u0441\u0442\u0440\u043e \u0441\u043a\u0430\u043d\u0438\u0440\u0443\u0435\u0442 \u0441\u0442\u0440\u043e\u043a\u0443 \u0432 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435, \u043f\u0440\u0435\u043a\u0440\u0430\u0449\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0443, \u0435\u0441\u043b\u0438 \u043a\u0430\u043a\u0438\u0435-\u043b\u0438\u0431\u043e  \u0441\u0438\u043c\u0432\u043e\u043b\u044b, \u043d\u0435 \u044f\u0432\u043b\u044f\u044e\u0449\u0438\u0435\u0441\u044f \u043c\u0435\u0442\u0430\u0441\u0438\u043c\u0432\u043e\u043b\u0430\u043c\u0438, \u043d\u0435 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0442.<\/p>\n<ul>\n<li>\n<p>\u041f\u043e\u043a\u0430 \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u0432 \u043e\u0431\u0435\u0438\u0445 \u0441\u0442\u0440\u043e\u043a\u0430\u0445 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0442 \u0438\u043b\u0438 \u0441\u0438\u043c\u0432\u043e\u043b \u0432 \u0448\u0430\u0431\u043b\u043e\u043d\u0435 \u0440\u0430\u0432\u0435\u043d <code>?<\/code> (\u0435\u0441\u043b\u0438 <code>?<\/code> \u043d\u0435 \u044d\u043a\u0440\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d), \u0438 \u043d\u0435 \u0434\u043e\u0441\u0442\u0438\u0433\u043d\u0443\u0442\u043e \u043d\u0430\u0447\u0430\u043b\u043e \u043e\u0431\u0435\u0438\u0445 \u0441\u0442\u0440\u043e\u043a, \u0438 \u0441\u0438\u043c\u0432\u043e\u043b \u0432 \u0448\u0430\u0431\u043b\u043e\u043d\u0435 \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <code>*<\/code>.<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u0441\u0438\u043c\u0432\u043e\u043b \u0432 \u0448\u0430\u0431\u043b\u043e\u043d\u0435 \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0435\u044d\u043a\u0440\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c <code>?<\/code>, \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u0447\u0435\u0442\u0447\u0438\u043a <code>close<\/code> \u0434\u043b\u044f \u0442\u043e\u0447\u043d\u043e\u0433\u043e \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u044f.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0438 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u0441\u0438\u043c\u0432\u043e\u043b \u0432 \u0448\u0430\u0431\u043b\u043e\u043d\u0435 \u044d\u043a\u0440\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u0412 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0443\u0441\u043b\u043e\u0432\u0438\u0439 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0442\u0441\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f:<\/p>\n<ul>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u0441\u0442\u0440\u043e\u043a\u0430 \u0441\u043e\u0432\u043f\u0430\u043b\u0430 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0431\u0435\u0437 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 <code>*<\/code>, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f <code>close + 1<\/code>.<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u043e\u0434\u043d\u0430 \u0438\u0437 \u0441\u0442\u0440\u043e\u043a \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u0430\u0441\u044c \u0434\u043e \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0432\u0441\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u0441\u0440\u0430\u0432\u043d\u0438\u043b\u0438\u0441\u044c, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f <code>0<\/code>.<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0435 \u0441\u0442\u0440\u043e\u043a\u0438, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f <code>0<\/code>.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d \u043d\u0435\u044d\u043a\u0440\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0441\u0438\u043c\u0432\u043e\u043b <code>*<\/code>, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u043e\u0435 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435:<\/p>\n<ul>\n<li>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0438 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u0441\u0438\u043c\u0432\u043e\u043b \u044d\u043a\u0440\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c.<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u0441\u0442\u0440\u043e\u043a\u0430 \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u0430\u0441\u044c, \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043e\u043d\u0430 \u0441\u043e\u0432\u043f\u0430\u043b\u0430 \u0441 \u043f\u0443\u0441\u0442\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u043e\u0439.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u044e\u0442\u0441\u044f \u0441\u0438\u043c\u0432\u043e\u043b\u044b <code>?<\/code>.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f, \u0435\u0441\u0442\u044c \u043b\u0438 \u043f\u043e\u0441\u043b\u0435 <code>*<\/code> \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0438\u043c\u0432\u043e\u043b \u0432 \u0448\u0430\u0431\u043b\u043e\u043d\u0435, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0433\u043e \u0446\u0438\u043a\u043b\u0430.<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u0442\u0441\u044f <code>*<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435 \u044d\u043a\u0440\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d, \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u044f.<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d \u043d\u0435\u044d\u043a\u0440\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 <code>*<\/code>, \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0444\u043b\u0430\u0433 <code>wild<\/code>.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u044d\u043a\u0440\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u043d\u0435 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0442 \u0438 <code>wild<\/code> \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0442 \u043a \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c\u0443 <code>*<\/code>.<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0442, \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f <code>close<\/code> \u0438 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u0442\u0441\u044f \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><code>wild<\/code> &#8212; \u0444\u043b\u0430\u0433, \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u0432 \u0448\u0430\u0431\u043b\u043e\u043d\u0435 \u0431\u044b\u043b \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d \u043d\u0435\u044d\u043a\u0440\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0441\u0438\u043c\u0432\u043e\u043b <code>*<\/code>. \u041a\u043e\u0433\u0434\u0430 <code>wild<\/code> \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u0432 1, \u044d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u044f <code>*<\/code>, \u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u0438\u0441\u043a\u0430\u0442\u044c \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u044f, \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 \u0434\u043b\u044f \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f.<br \/> <code>close<\/code> &#8212; \u0441\u0447\u0435\u0442\u0447\u0438\u043a, \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u044e\u0449\u0438\u0439 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0442\u043e\u0447\u043d\u044b\u0445 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0439 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u043c\u0435\u0436\u0434\u0443 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u043c \u0438 \u0441\u0442\u0440\u043e\u043a\u043e\u0439. \u042d\u0442\u043e\u0442 \u0441\u0447\u0435\u0442\u0447\u0438\u043a \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438 \u0442\u043e\u0447\u043d\u043e\u043c \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0438 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432, \u0442\u043e \u0435\u0441\u0442\u044c \u043a\u043e\u0433\u0434\u0430 \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u0432 \u0448\u0430\u0431\u043b\u043e\u043d\u0435 \u0438 \u0441\u0442\u0440\u043e\u043a\u0435 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0442, \u0438\u043b\u0438 \u043a\u043e\u0433\u0434\u0430 \u0441\u0438\u043c\u0432\u043e\u043b \u0432 \u0448\u0430\u0431\u043b\u043e\u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0435\u044d\u043a\u0440\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c <code>?<\/code>.<br \/> \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 0 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0435\u0441\u043b\u0438 \u0441\u0442\u0440\u043e\u043a\u0438 \u043d\u0435 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0442, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0431\u043e\u043b\u044c\u0448\u0435 0 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u043d\u0430 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0442\u043e\u0447\u043d\u044b\u0445 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0439 (\u0431\u0435\u0437 \u0443\u0447\u0435\u0442\u0430 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 <code>*<\/code> \u0438 <code>?<\/code>).<\/p>\n<p>\u041d\u0435 \u043c\u0435\u043d\u0435\u0435 \u0437\u0430\u043f\u0443\u0442\u0430\u043d\u043d\u044b\u043c \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043a\u043e\u0434 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0441\u0430\u043c\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u0430:<\/p>\n<pre><code class=\"cpp\">\/*  * CheckAccess  *  * Returns -1 if access file wasn't found  *          0 if user is allowed access  *          1 if user is denied access  *          2 if user is allowed access but should not be logged  *\/ int CheckAccess(char *fn, int *email_req, int *password_req) { FILE *fp; char *r,*s,*ss=NULL,*t; char buf[128]; char filename[1024]; int Access=0; int Match=0; int DefAccess=0;  \/* Default is to allow if not specified *\/ int old_em=0; int old_pw=0;  #if DEBUG fprintf(fperr,\"In CheckAccess: NoInfo=%d\\n\",NoInfo); fflush(fperr); #endif  strcpy(filename,fn); s=strrchr(filename,'.'); if(s) *s='\\0'; if((s=strrchr(filename,'\/'))) s++; else s=filename; if(ACCDIR[0]!='\/') FixFilename(ACCDIR,buf); else strcpy(buf,ACCDIR); ss=buf+strlen(buf)-1; if(*ss!='\/') strcat(buf,\"\/\"); strcat(buf,s); strcat(buf,\".acc\"); #if DEBUG fprintf(fperr,\"Checking access file [%s]\\n\",buf); fflush(fperr); #endif fp=fopen(buf,\"r\"); if(!fp) return(-1); while(!feof(fp)) { Match=0; Access=0; if(fgets(buf,127,fp)) { if(buf[0]=='#') continue;  \/* ignore comments *\/ s=strchr(buf,' '); \/* accept both space and tab as separator *\/ t=strchr(buf,'\\t'); if(!s &amp;&amp; t) s=t; if(s &amp;&amp; t &amp;&amp; t&lt;s) t=s; if(!s) continue; *s='\\0'; if(!strcasecmp(buf,\"public\")) { DefAccess=0; continue; } if(!strcasecmp(buf,\"private\")) { DefAccess=1; continue; } if(!strcasecmp(buf,\"allow\")) Access=0; else if(!strcasecmp(buf,\"ban\")) Access=1; else if(!strcasecmp(buf,\"nolog\")) Access=2; else if(!strcasecmp(buf,\"noinfo\") &amp;&amp; NoInfo != 2) NoInfo=1; else if(!strcasecmp(buf,\"info\")) NoInfo+=3; else if(!strcasecmp(buf,\"passwordform\")) { strcpy(PasswordForm,s+1); t=PasswordForm+strlen(PasswordForm)-1; if(*t=='\\n') *t='\\0'; #if DEBUG fprintf(fperr,\"PasswordForm=[%s]\\n\",PasswordForm); fflush(fperr); #endif } else if(!strcasecmp(buf,\"emailform\")) { strcpy(EmailForm,s+1); t=EmailForm+strlen(EmailForm)-1; if(*t=='\\n') *t='\\0'; #if DEBUG fprintf(fperr,\"EmailForm=[%s]\\n\",EmailForm); fflush(fperr); #endif } else if(!strcasecmp(buf,\"email\")&amp;&amp;*email_req==0) { *email_req=1; } else if(!strcasecmp(buf,\"noemail\")) { old_em=*email_req; *email_req=4; } else if(!strcasecmp(buf,\"password\")&amp;&amp;*password_req==0) { r=s+1; while(*r==' ' || *r=='\\t') r++; if(strlen(r)==0) continue; s=strchr(r,' '); \/* accept both space and tab as separator *\/ t=strchr(r,'\\t'); if(!s &amp;&amp; t) s=t; if(s &amp;&amp; t &amp;&amp; t&lt;s) t=s; if(!s) continue; *s='\\0'; strcpy(acc_password,r); *password_req=1; } else if(!strcasecmp(buf,\"nopassword\")) { old_pw=*password_req; *password_req=4; } r=s+1; \/* Strip leading spaces\/tabs *\/ while(*r==' ' || *r=='\\t') r++; if(strlen(r)==0) continue; s=r; s+=strlen(r)-1; while(*s==' ' || *s=='\\t' || *s=='\\n' || *s=='\\r') s--; *(s+1)='\\0'; if(!strncasecmp(r,\"mail:\",5)) { r+=5; if(strlen(r)==0) continue; if(email_addr &amp;&amp; strlen(email_addr)) strcpy(filename,email_addr); else continue; } else if(!strncasecmp(r,\"browser:\",8)) { r+=8; if(strlen(r)==0) continue; if(agent &amp;&amp; strlen(agent)) strcpy(filename,agent); else continue; } else if(!strncasecmp(r,\"referer:\",8)) { r+=8; if(strlen(r)==0) continue; if(referer &amp;&amp; strlen(referer))  strcpy(filename,referer); else continue; } else sprintf(filename,\"%s@%s\",user,host); #if DEBUG fprintf(fperr,\"Matching [%s] [%s]\\n\",filename,r); fflush(fperr); #endif if(wild_match(r,filename)!=0) { #if DEBUG fprintf(fperr,\"Got Match\\n\"); fflush(fperr); #endif if(*email_req==1) { *email_req=2; continue; } if(*email_req==4) { *email_req=3; continue; } if(*password_req==1) { *password_req=2; continue; } if(*password_req==4) { *password_req=3; continue; } if(NoInfo!=1 &amp;&amp; NoInfo!=3 &amp;&amp; NoInfo!=5) { Match=1; break; } else if(NoInfo==1) NoInfo=2; else NoInfo=0; } else { if(NoInfo==1 || NoInfo==3) NoInfo=0; if(*password_req==1) *password_req=0; if(*password_req==4) *password_req=old_pw; if(*email_req==1) *email_req=0; if(*email_req==4) *email_req=old_em; #if DEBUG fprintf(fperr,\"No Match\\n\"); fflush(fperr); #endif } } } fclose(fp);  #if DEBUG fprintf(fperr,\"Leaving CheckAccess: NoInfo=%d em=%d pw=%d\\n\",NoInfo,*email_req,*password_req); fflush(fperr); #endif  if(Match) return(Access); else return(DefAccess); } <\/code><\/pre>\n<p>\u041e\u0431\u0449\u0438\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0442\u0430\u043a\u043e\u0432:<\/p>\n<ul>\n<li>\n<p>\u041f\u043e\u0441\u0442\u0440\u043e\u0447\u043d\u043e \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0444\u0430\u0439\u043b\u0430 \u0438 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u0436\u0434\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u0441\u0442\u0440\u043e\u043a\u0430 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0441 \u0441\u0438\u043c\u0432\u043e\u043b\u0430 <code>#<\/code>, \u043e\u043d\u0430 \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u043c \u0438 \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f.<\/p>\n<\/li>\n<li>\n<p>\u0418\u043d\u0430\u0447\u0435 \u0441\u0442\u0440\u043e\u043a\u0430 \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u0434\u0432\u0435 \u0447\u0430\u0441\u0442\u0438: \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e \u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435. \u0415\u0441\u043b\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043f\u0440\u043e\u0431\u0435\u043b\u044b \u0438\u043b\u0438 \u0442\u0430\u0431\u0443\u043b\u044f\u0446\u0438\u0438, \u043e\u043d\u0438 \u0443\u0434\u0430\u043b\u044f\u044e\u0442\u0441\u044f.<\/p>\n<\/li>\n<li>\n<p>\u0412 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430, \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u0430:<\/p>\n<ul>\n<li>\n<p><code>public<\/code> &#8212; \u0434\u043e\u0441\u0442\u0443\u043f \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d \u0432\u0441\u0435\u043c.<\/p>\n<\/li>\n<li>\n<p><code>private<\/code> &#8212; \u0434\u043e\u0441\u0442\u0443\u043f \u0437\u0430\u043f\u0440\u0435\u0449\u0435\u043d \u0432\u0441\u0435\u043c.<\/p>\n<\/li>\n<li>\n<p><code>allow<\/code> &#8212; \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d \u0434\u043e\u0441\u0442\u0443\u043f.<\/p>\n<\/li>\n<li>\n<p><code>ban<\/code> &#8212; \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0437\u0430\u043f\u0440\u0435\u0449\u0435\u043d \u0434\u043e\u0441\u0442\u0443\u043f.<\/p>\n<\/li>\n<li>\n<p><code>nolog<\/code> &#8212; \u043e\u0442\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u043e\u0441\u0435\u0449\u0435\u043d\u0438\u044f.<\/p>\n<\/li>\n<li>\n<p><code>noinfo<\/code> &#8212; \u043e\u0442\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u043f\u043e\u043a\u0430\u0437 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438 \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f.<\/p>\n<\/li>\n<li>\n<p><code>info<\/code> &#8212; \u0440\u0430\u0437\u0440\u0435\u0448\u0430\u0435\u0442 \u043f\u043e\u043a\u0430\u0437 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438 \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f<\/p>\n<\/li>\n<li>\n<p><code>passwordform<\/code>, <code>emailform<\/code> &#8212; \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0435 \u0444\u043e\u0440\u043c\u044b \u0434\u043b\u044f \u0432\u0432\u043e\u0434\u0430 \u043f\u0430\u0440\u043e\u043b\u044f \u0438 email \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e.<\/p>\n<\/li>\n<li>\n<p><code>email<\/code> &#8212; \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f email \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430.<\/p>\n<\/li>\n<li>\n<p><code>noemail<\/code> &#8212; email \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f.<\/p>\n<\/li>\n<li>\n<p><code>password<\/code> &#8212; \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u0430\u0440\u043e\u043b\u044c \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430.<\/p>\n<\/li>\n<li>\n<p><code>nopassword<\/code> &#8212; \u043f\u0430\u0440\u043e\u043b\u044c \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u0441\u0442\u0440\u043e\u043a\u0430 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0441 <code>mail:<\/code>, <code>browser:<\/code>, <code>referer:<\/code>, \u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 (email, \u0431\u0440\u0430\u0443\u0437\u0435\u0440, \u0441\u0441\u044b\u043b\u043a\u0430), \u0447\u0442\u043e\u0431\u044b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0435.<\/p>\n<\/li>\n<\/ul>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0430 \u043c\u0430\u0441\u043a\u0430 \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 wild_match. \u0415\u0441\u043b\u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u044c <code>email *<\/code> \u0442\u043e \u043f\u043e\u0434\u043e\u0439\u0434\u0435\u0442 \u043b\u044e\u0431\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430 <\/p>\n<p>\u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0442\u044c e-mail \u0438 \u043f\u0430\u0440\u043e\u043b\u044c \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435:<\/p>\n<p>protected.acc:<\/p>\n<pre><code class=\"lua\">private email *  password secret *<\/code><\/pre>\n<p>protected.html:<\/p>\n<pre><code class=\"xml\">&lt;center> &lt;!-- Hello $email! --> &lt;br> This is protected page! &lt;br> &lt;\/center><\/code><\/pre>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/130\/f20\/34b\/130f2034bea971842e412c96baa5d68c.png\" alt=\"\u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0430\u044f \u0444\u043e\u0440\u043c\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 e-mail \u0438 \u043f\u0430\u0440\u043e\u043b\u044f, \u0444\u043e\u0440\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u043a\u0430\u0441\u0442\u043e\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c\" title=\"\u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0430\u044f \u0444\u043e\u0440\u043c\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 e-mail \u0438 \u043f\u0430\u0440\u043e\u043b\u044f, \u0444\u043e\u0440\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u043a\u0430\u0441\u0442\u043e\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c\" width=\"623\" height=\"348\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/130\/f20\/34b\/130f2034bea971842e412c96baa5d68c.png\"\/><\/p>\n<div><figcaption>\u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0430\u044f \u0444\u043e\u0440\u043c\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 e-mail \u0438 \u043f\u0430\u0440\u043e\u043b\u044f, \u0444\u043e\u0440\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u043a\u0430\u0441\u0442\u043e\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c<\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/da8\/890\/89e\/da889089e6514a74dd08094393686440.png\" alt=\"\u041f\u043e\u0441\u043b\u0435 \u0432\u0432\u043e\u0434\u0430 e-mail \u0438 \u043f\u0430\u0440\u043e\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u043c\u0443\" title=\"\u041f\u043e\u0441\u043b\u0435 \u0432\u0432\u043e\u0434\u0430 e-mail \u0438 \u043f\u0430\u0440\u043e\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u043c\u0443\" width=\"625\" height=\"181\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/da8\/890\/89e\/da889089e6514a74dd08094393686440.png\"\/><\/p>\n<div><figcaption>\u041f\u043e\u0441\u043b\u0435 \u0432\u0432\u043e\u0434\u0430 e-mail \u0438 \u043f\u0430\u0440\u043e\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u043c\u0443<\/figcaption><\/div>\n<\/figure>\n<p>\u0412 html \u0444\u0430\u0439\u043b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u044b \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0435\u0440\u043c\u0435\u043d\u043d\u044b\u0435 \u043e\u0431\u0449\u0438\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0442\u0430\u043a\u043e\u0432:<\/p>\n<pre><code>&lt;!-- $var --><\/code><\/pre>\n<p>\u0417\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u0438\u0437 \u0434\u0430\u043d\u043d\u044b\u0445 post \u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u0422\u0430\u043a\u0436\u0435 \u0435\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e &#171;\u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0445&#187; \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 &#8212; (cnt, todays_cnt, lasttime, lastuser, modtime, VERSION, email_addr, referer, agent, short_agent, raw_file) \u043e\u043d\u0438 \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438 \u0432 \u0444\u0443\u0442\u0435\u0440\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b.<\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <code>env<\/code> \u0438\u043b\u0438 <code>version<\/code> <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/959\/d89\/b34\/959d89b340bc1762992f0d4420f1ecb5.png\" width=\"625\" height=\"542\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/959\/d89\/b34\/959d89b340bc1762992f0d4420f1ecb5.png\"\/><\/figure>\n<p><strong><br \/>phpf.cgi<\/strong><\/p>\n<p>phpf.cgi &#8212; \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0449\u0430\u044f \u0437\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u0444\u043e\u0440\u043c, \u0438\u0445 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435.<\/p>\n<p>\u0414\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0435\u0440\u0432\u044b\u043c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0444\u043e\u0440\u043c\u044b, \u0432\u0442\u043e\u0440\u044b\u043c, \u043e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e, &#8212; \u0430\u0434\u0440\u0435\u0441 \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u043f\u043e\u0441\u043b\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code>phpf.cgi form_name phpl.cgi?index.html<\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u0441\u0442\u0440\u0430\u043d\u0438\u0447\u043a\u0443 \u0441 \u0444\u043e\u0440\u043c\u043e\u0439 \u0432\u0432\u043e\u0434\u0430 \u0438\u043c\u0435\u043d\u0438 \u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f:<\/p>\n<pre><code class=\"xml\">&lt;!DOCTYPE html> &lt;html> &lt;head>     &lt;title>Feedback Form&lt;\/title> &lt;\/head> &lt;body>     &lt;h1>Feedback Form&lt;\/h1>     &lt;form method=\"post\" action=\"phpf.cgi?form_name+phpl.cgi?index.html\">         &lt;label for=\"name\">Name:&lt;\/label>         &lt;input type=\"text\" id=\"name\" name=\"name\" required>&lt;br>&lt;br>         &lt;label for=\"comment\">Comment:&lt;\/label>&lt;br>         &lt;textarea id=\"comment\" name=\"comment\" rows=\"4\" cols=\"50\" required>&lt;\/textarea>&lt;br>&lt;br>         &lt;input type=\"submit\" value=\"Submit\">     &lt;\/form> &lt;\/body> &lt;\/html><\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/5df\/867\/6cb\/5df8676cb700e4f342bc0a1616151f2a.png\" width=\"626\" height=\"366\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5df\/867\/6cb\/5df8676cb700e4f342bc0a1616151f2a.png\"\/><\/figure>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0444\u043e\u0440\u043c\u044b \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u044b \u0432 .res \u0444\u0430\u0439\u043b \u0432 \u043f\u0430\u043f\u043a\u0435 forms. <br \/>\u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0444\u043e\u0440\u043c\u044b \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0432\u0438\u0434\u0430 show filename xField, \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0439 \u0444\u043e\u0440\u043c\u044b \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/9d8\/c25\/9e2\/9d8c259e2ad037d822c949704b710591.png\" alt=\"\u041f\u0440\u043e\u0441\u043c\u043e\u0442\u0440 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445\" title=\"\u041f\u0440\u043e\u0441\u043c\u043e\u0442\u0440 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445\" width=\"624\" height=\"218\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9d8\/c25\/9e2\/9d8c259e2ad037d822c949704b710591.png\"\/><\/p>\n<div><figcaption>\u041f\u0440\u043e\u0441\u043c\u043e\u0442\u0440 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445<\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u0435\u0440\u0435\u0434 \u0438\u043c\u0435\u043d\u0435\u043c \u043f\u043e\u043b\u044f \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0435\u0444\u0438\u043a\u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0449\u0438\u0439 \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b:<\/p>\n<ul>\n<li>\n<p>m\/M &#8212; \u0434\u043b\u044f e-mail<\/p>\n<\/li>\n<li>\n<p>l\/L &#8212; \u0434\u043b\u044f \u0441\u0441\u044b\u043b\u043e\u043a<\/p>\n<\/li>\n<li>\n<p>t\/T &#8212; \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u0442\u0435\u043a\u0441\u0442<\/p>\n<\/li>\n<li>\n<p>i\/I &#8212; \u043a\u0443\u0440\u0441\u0438\u0432<\/p>\n<\/li>\n<li>\n<p>b\/B &#8212; \u0436\u0438\u0440\u043d\u044b\u0439 \u0442\u0435\u043a\u0441\u0442<\/p>\n<\/li>\n<\/ul>\n<p>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430 \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0449\u0438\u0439 \u0437\u0430 \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435:<\/p>\n<pre><code class=\"cpp\">void PrintFormType(int type, char *field, char *text) { switch(type) { case 'M': if(field) printf(\"&lt;b>%s:&lt;\/b> &lt;a href=\\\"mailto:%s\\\">%s&lt;\/a>&lt;br>\\n\",field,text,text); else printf(\"&lt;a href=\\\"mailto:%s\\\">%s&lt;\/a>&lt;br>\\n\",text,text); break; case 'm': if(field) printf(\"&lt;b>%s:&lt;\/b> &lt;a href=\\\"mailto:%s\\\">%s&lt;\/a> \\n\",field,text,text); else printf(\"&lt;a href=\\\"mailto:%s\\\">%s&lt;\/a> \\n\",text,text); break; case 'L': if(field) printf(\"&lt;b>%s:&lt;\/b> &lt;a href=\\\"%s\\\">%s&lt;\/a>&lt;br>\\n\",field,text,text); else printf(\"&lt;a href=\\\"%s\\\">%s&lt;\/a>&lt;br>\\n\",text,text); break; case 'l': if(field) printf(\"&lt;b>%s:&lt;\/b> &lt;a href=\\\"%s\\\">%s&lt;\/a> \\n\",field,text,text); else printf(\"&lt;a href=\\\"%s\\\">%s&lt;\/a> \\n\",text,text); break; case 'T': if(field) printf(\"&lt;b>%s:&lt;\/b> %s&lt;br>\",field,text); else printf(\"%s&lt;br>\",text); break; case 't': if(field) printf(\"&lt;b>%s:&lt;\/b> %s \",field,text); else printf(\"%s \",text); break; case 'I': if(field) printf(\"&lt;b>%s:&lt;\/b> &lt;i>%s&lt;\/i>&lt;br>\",field,text); else printf(\"&lt;i>%s&lt;\/i>&lt;br>\",text); break; case 'i': if(field) printf(\"&lt;b>%s:&lt;\/b> &lt;i>%s&lt;\/i> \",field,text); else printf(\"&lt;i>%s&lt;\/i> \",text); break; case 'B': if(field) printf(\"&lt;b>%s:&lt;\/b> &lt;b>%s&lt;\/b>&lt;br>\",field,text); else printf(\"&lt;b>%s&lt;\/b>&lt;br>\",text); break; case 'b': if(field) printf(\"&lt;b>%s:&lt;\/b> &lt;b>%s&lt;\/b> \",field,text); else printf(\"&lt;b>%s&lt;\/b> \",text); break; } }<\/code><\/pre>\n<p><strong>phplmon.cgi<\/strong><\/p>\n<p>\u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043b\u043e\u0433\u043e\u0432 \u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438 \u043f\u043e\u0441\u0435\u0449\u0435\u043d\u0438\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446. \u0415\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u0430: \u043e\u043d\u0430 \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u0444\u0430\u0439\u043b\u044b .cnt, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 phpl.cgi, \u0438 \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 \u0442\u0430\u0431\u043b\u0438\u0447\u043d\u043e\u043c \u0432\u0438\u0434\u0435 &#8212; \u0438\u043c\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b, \u0432\u0441\u0435\u0433\u043e \u043f\u043e\u0441\u0435\u0449\u0435\u043d\u0438\u0439, \u043f\u043e\u0441\u0435\u0449\u0435\u043d\u0438\u0439 \u0437\u0430 \u0434\u0435\u043d\u044c, \u0434\u0430\u0442\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u043f\u043e\u0441\u0435\u0449\u0435\u043d\u0438\u044f \u0438 \u043a\u0435\u043c \u0431\u044b\u043b\u0430 \u043f\u043e\u0441\u0435\u0449\u0435\u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/dd7\/d0d\/f9d\/dd7d0df9dacd29328c5f52307cdddf8d.png\" alt=\"\u0421\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 \u043f\u043e\u0441\u0435\u0449\u0435\u043d\u0438\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\" title=\"\u0421\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 \u043f\u043e\u0441\u0435\u0449\u0435\u043d\u0438\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\" width=\"624\" height=\"242\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/dd7\/d0d\/f9d\/dd7d0df9dacd29328c5f52307cdddf8d.png\"\/><\/p>\n<div><figcaption>\u0421\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 \u043f\u043e\u0441\u0435\u0449\u0435\u043d\u0438\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446<\/figcaption><\/div>\n<\/figure>\n<p><strong>phplview.cgi<\/strong><\/p>\n<p>\u041f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0443\u044e \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443 \u043f\u043e \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u043f\u043e\u0441\u0435\u0449\u0435\u043d\u0438\u044e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b, \u0434\u0430\u043d\u043d\u044b\u0435 \u0431\u0435\u0440\u0443\u0442\u0441\u044f \u0438\u0437 \u0444\u0430\u0439\u043b\u043e\u0432 .log \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0442\u0430\u043a\u0436\u0435 \u043f\u0438\u0448\u0435\u0442 phpl.cgi.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/564\/2ed\/02e\/5642ed02e7604bdadbc6a390e0389af1.png\" alt=\"\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 \u043f\u043e\u0441\u0435\u0449\u0435\u043d\u0438\u0439 \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b\" title=\"\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 \u043f\u043e\u0441\u0435\u0449\u0435\u043d\u0438\u0439 \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b\" width=\"620\" height=\"430\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/564\/2ed\/02e\/5642ed02e7604bdadbc6a390e0389af1.png\"\/><\/p>\n<div><figcaption>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 \u043f\u043e\u0441\u0435\u0449\u0435\u043d\u0438\u0439 \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b<\/figcaption><\/div>\n<\/figure>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0422\u0430\u043a\u043e\u0439 \u0431\u044b\u043b\u0430 \u0441\u0430\u043c\u0430\u044f \u043f\u0435\u0440\u0432\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f PHP \u0432\u044b\u043b\u043e\u0436\u0435\u043d\u043d\u0430\u044f \u0432 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u0432 1995 \u0433\u043e\u0434\u0443. \u041d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043d\u0430\u0431\u043e\u0440 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0434\u043b\u044f \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430, \u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438 \u043f\u043e\u0441\u0435\u0449\u0435\u043d\u0438\u0439 \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u0435\u0431-\u0444\u043e\u0440\u043c.<\/p>\n<p>\u042d\u0442\u043e\u0442 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e \u0420\u0430\u0441\u043c\u0443\u0441\u0430 \u041b\u0435\u0440\u0434\u043e\u0440\u0444\u0430, \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u041a\u0435\u0432\u0438\u043d\u043e\u043c \u042f\u043d\u043a\u043e\u043c \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 SitePoint \u0432 2002 \u0433\u043e\u0434\u0443, \u0440\u0430\u0441\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0435 \u0430\u0441\u043f\u0435\u043a\u0442\u044b \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u044f PHP \u0438 \u0435\u0433\u043e \u043e\u0442\u043b\u0438\u0447\u0438\u044f \u043e\u0442 \u0434\u0440\u0443\u0433\u0438\u0445 \u044f\u0437\u044b\u043a\u043e\u0432.<\/p>\n<p><strong>SP<\/strong>: \u0427\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u043b\u043e \u0432\u0430\u0441 \u043a \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 PHP? \u0418 \u0447\u0442\u043e, \u043f\u043e \u0432\u0430\u0448\u0435\u043c\u0443 \u043c\u043d\u0435\u043d\u0438\u044e, \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442 \u044d\u0442\u043e\u0442 \u044f\u0437\u044b\u043a \u043e\u0442 \u0434\u0440\u0443\u0433\u0438\u0445?<\/p>\n<p><strong>RL<\/strong>: \u041f\u0435\u0440\u0432\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f PHP \u0431\u044b\u043b\u0430 \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u043d\u0430\u0431\u043e\u0440\u043e\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f \u0441\u043e\u0437\u0434\u0430\u043b \u0434\u043b\u044f \u0441\u0432\u043e\u0435\u0433\u043e \u0432\u0435\u0431-\u0441\u0430\u0439\u0442\u0430 \u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432. \u041e\u0434\u0438\u043d \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u043b \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443 \u043f\u043e\u0441\u0435\u0449\u0435\u043d\u0438\u0439 \u0432 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 mSQL, \u0434\u0440\u0443\u0433\u043e\u0439 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u043e\u0432\u0430\u043b \u0434\u0430\u043d\u043d\u044b\u0435 \u0444\u043e\u0440\u043c\u044b. \u0412 \u0438\u0442\u043e\u0433\u0435 \u0443 \u043c\u0435\u043d\u044f \u0431\u044b\u043b\u043e \u043e\u043a\u043e\u043b\u043e 30 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0445 CGI-\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 C, \u043f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043c\u043d\u0435 \u044d\u0442\u043e \u043d\u0430\u0434\u043e\u0435\u043b\u043e, \u0438 \u044f \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u043b \u0438\u0445 \u0432\u0441\u0435 \u0432 \u043e\u0434\u043d\u0443 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u043d\u0430 C. \u0417\u0430\u0442\u0435\u043c \u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0430\u0440\u0441\u0435\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u043b \u0442\u0435\u0433\u0438 \u0438\u0437 HTML-\u0444\u0430\u0439\u043b\u043e\u0432 \u0438 \u0437\u0430\u043c\u0435\u043d\u044f\u043b \u0438\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 \u043d\u0430 C.<\/p>\n<p>\u042d\u0442\u043e\u0442 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0430\u0440\u0441\u0435\u0440 \u043f\u043e\u0441\u0442\u0435\u043f\u0435\u043d\u043d\u043e \u0441\u0442\u0430\u043b \u0432\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0443\u0441\u043b\u043e\u0432\u043d\u044b\u0435 \u0442\u0435\u0433\u0438, \u0437\u0430\u0442\u0435\u043c \u0446\u0438\u043a\u043b\u044b, \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u0442. \u0434. \u041d\u0438 \u0432 \u043e\u0434\u0438\u043d \u043c\u043e\u043c\u0435\u043d\u0442 \u044f \u043d\u0435 \u0434\u0443\u043c\u0430\u043b, \u0447\u0442\u043e \u043f\u0438\u0448\u0443 \u044f\u0437\u044b\u043a \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0435\u0432. \u042f \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u043b \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043a \u043f\u0430\u0440\u0441\u0435\u0440\u0443 \u043c\u0430\u043a\u0440\u043e\u0441\u043e\u0432. \u0412\u0441\u044e \u0441\u0432\u043e\u044e \u0440\u0435\u0430\u043b\u044c\u043d\u0443\u044e \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0443 \u044f \u0432\u0441\u0435 \u0435\u0449\u0435 \u043f\u0438\u0441\u0430\u043b \u043d\u0430 C.<\/p>\n<p>\u0412 \u043a\u043e\u043d\u0446\u0435 \u043a\u043e\u043d\u0446\u043e\u0432, \u0442\u043e, \u0447\u0442\u043e, \u043f\u043e \u043c\u043e\u0435\u043c\u0443 \u043c\u043d\u0435\u043d\u0438\u044e, \u0432\u044b\u0434\u0435\u043b\u044f\u043b\u043e PHP \u043d\u0430 \u0440\u0430\u043d\u043d\u0438\u0445 \u044d\u0442\u0430\u043f\u0430\u0445 \u0438 \u0434\u043e \u0441\u0438\u0445 \u043f\u043e\u0440 \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u0442 \u0435\u0433\u043e \u0441\u0440\u0435\u0434\u0438 \u0434\u0440\u0443\u0433\u0438\u0445, \u044d\u0442\u043e \u0442\u043e, \u0447\u0442\u043e \u043e\u043d \u0432\u0441\u0435\u0433\u0434\u0430 \u0441\u0442\u0440\u0435\u043c\u0438\u0442\u0441\u044f \u043d\u0430\u0439\u0442\u0438 \u0441\u0430\u043c\u044b\u0439 \u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 \u043f\u0443\u0442\u044c \u043a \u0440\u0435\u0448\u0435\u043d\u0438\u044e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0437\u0430\u0434\u0430\u0447 \u0432\u0435\u0431\u0430. \u041e\u043d \u043d\u0435 \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u0431\u044b\u0442\u044c \u044f\u0437\u044b\u043a\u043e\u043c \u043e\u0431\u0449\u0435\u0433\u043e \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u0438 \u043b\u044e\u0431\u043e\u0439, \u043a\u0442\u043e \u0438\u0449\u0435\u0442 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0432\u0435\u0431-\u0437\u0430\u0434\u0430\u0447\u0438, \u043e\u0431\u044b\u0447\u043d\u043e \u043d\u0430\u0439\u0434\u0435\u0442 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u044f\u043c\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0447\u0435\u0440\u0435\u0437 PHP. \u041c\u043d\u043e\u0433\u0438\u0435 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u044e\u0442, \u0447\u0442\u043e \u0440\u0435\u0448\u0430\u044e\u0442 \u0437\u0430\u0434\u0430\u0447\u0438 \u0432\u0435\u0431\u0430, \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0441\u043b\u043e\u0436\u043d\u044b. \u041a\u043e\u0433\u0434\u0430 \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u0447\u0442\u043e-\u0442\u043e \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e \u043a \u043f\u044f\u0442\u043d\u0438\u0446\u0435, \u0447\u0442\u043e\u0431\u044b \u0432\u044b \u043d\u0435 \u043f\u0440\u043e\u0432\u0435\u043b\u0438 \u0432\u0441\u0451 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043b\u0438\u0441\u0442\u044b\u0432\u0430\u044f 800-\u0441\u0442\u0440\u0430\u043d\u0438\u0447\u043d\u044b\u0435 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430, PHP \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0445\u043e\u0440\u043e\u0448\u043e.<\/p>\n<p><strong>SP<\/strong>:  \u041a\u0430\u043a\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435, \u043f\u043e \u0432\u0430\u0448\u0435\u043c\u0443 \u043c\u043d\u0435\u043d\u0438\u044e, \u0431\u044b\u043b\u043e \u0441\u0430\u043c\u044b\u043c \u0432\u0430\u0436\u043d\u044b\u043c \u0437\u0430 \u0433\u043e\u0434\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 PHP? \u0415\u0441\u0442\u044c \u043b\u0438 \u043a\u0430\u043a\u0438\u0435-\u043b\u0438\u0431\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b \u043f\u0440\u0438\u043d\u044f\u043b\u0438, \u0438 \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u0430\u043c \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b, \u0447\u0442\u043e\u0431\u044b \u0432\u044b \u043f\u0440\u0438\u043d\u044f\u043b\u0438 \u0438\u0445 \u043f\u043e-\u0434\u0440\u0443\u0433\u043e\u043c\u0443?<\/p>\n<p><strong>RL<\/strong>: \u041c\u043d\u0435 \u0442\u0440\u0443\u0434\u043d\u043e \u043f\u0435\u0440\u0435\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u044b\u043b\u0438 \u043f\u0440\u0438\u043d\u044f\u0442\u044b 6 \u0438\u043b\u0438 7 \u043b\u0435\u0442 \u043d\u0430\u0437\u0430\u0434, \u043a\u043e\u0433\u0434\u0430 PHP \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f \u0432\u0441\u0435\u0433\u043e \u043e\u0434\u043d\u0438\u043c \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u043e\u043c. \u041d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0439\u0442\u0435, \u0447\u0442\u043e \u044f \u043d\u0435 \u0441\u0435\u043b \u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432\u044b\u0439 \u044f\u0437\u044b\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 9 \u043c\u0438\u043b\u043b\u0438\u043e\u043d\u043e\u0432 \u0434\u043e\u043c\u0435\u043d\u043e\u0432: \u044f \u0441\u0435\u043b \u0440\u0435\u0448\u0438\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443. \u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043a 17:00, \u0447\u0442\u043e\u0431\u044b \u0432\u044b \u043c\u043e\u0433\u043b\u0438 \u043f\u043e\u0439\u0442\u0438 \u0432 \u043a\u0438\u043d\u043e \u0441\u043e \u0441\u0432\u043e\u0435\u0439 \u0434\u0435\u0432\u0443\u0448\u043a\u043e\u0439, \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0430\u0441\u043f\u0435\u043a\u0442\u0430\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u044b 7 \u043b\u0435\u0442 \u0441\u043f\u0443\u0441\u0442\u044f, \u043a\u043e\u0433\u0434\u0430 \u0442\u044b\u0441\u044f\u0447\u0430\u043c \u043b\u044e\u0434\u0435\u0439 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0430\u0434 \u0442\u0435\u043c \u0445\u0430\u043a\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u043f\u043e\u0437\u0434\u043d\u0435\u0439 \u043d\u043e\u0447\u044c\u044e.<\/p>\n<p>\u0421\u0430\u043c\u043e\u0435 \u0432\u0430\u0436\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u044f \u043f\u0440\u0438\u043d\u044f\u043b, \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u044d\u0442\u043e \u0431\u044b\u043b\u043e \u043e\u0442\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043e\u0442 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f. \u041e\u0442\u043a\u0440\u044b\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442 \u0438 \u0434\u0430\u0442\u044c \u043f\u043e\u0447\u0442\u0438 \u0432\u0441\u0435\u043c, \u043a\u0442\u043e \u043f\u0440\u043e\u0441\u0438\u043b, \u043f\u043e\u043b\u043d\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u0430\u043c PHP. \u042d\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u043b\u043e \u043a \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044e \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u0445 \u0442\u0430\u043b\u0430\u043d\u0442\u043e\u0432, \u0438 \u043b\u044e\u0434\u0438 \u043e\u0431\u044b\u0447\u043d\u043e \u0447\u0443\u0432\u0441\u0442\u0432\u043e\u0432\u0430\u043b\u0438 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0435 \u0447\u0443\u0432\u0441\u0442\u0432\u043e \u043f\u0440\u0438\u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438. \u041f\u0440\u043e\u0435\u043a\u0442 PHP, \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u043e\u0434\u0438\u043d \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u043a\u0440\u0443\u043f\u043d\u044b\u0445 \u043f\u043e \u0447\u0438\u0441\u043b\u0443 \u043b\u044e\u0434\u0435\u0439 \u0441 \u0434\u043e\u0441\u0442\u0443\u043f\u043e\u043c \u043a \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044e CVS, \u0433\u0434\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043a\u043e\u0434 \u0438 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f.<\/p>\n<p>\u041d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0434\u043b\u044f \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u044f \u043d\u0430 <a href=\"https:\/\/github.com\/ArtUkrainskiy\/php1\" rel=\"noopener noreferrer nofollow\">github<\/a>.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><\/p>\n<div class=\"tm-article-poll-container\"><!--[--><\/p>\n<div class=\"tm-article-poll tm-article-poll_variant-bordered\">\n<div class=\"tm-notice tm-notice_positive tm-article-poll__notice\"><!----><\/p>\n<div class=\"tm-notice__inner\"><!----><\/p>\n<div class=\"tm-notice__content\" data-test-id=\"notice-content\"><!--[--><span>\u0422\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u043c\u043e\u0433\u0443\u0442 \u0443\u0447\u0430\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0432 \u043e\u043f\u0440\u043e\u0441\u0435. <a rel=\"nofollow\" href=\"\/kek\/v1\/auth\/habrahabr\/?back=\/ru\/articles\/787250\/&#038;hl=ru\">\u0412\u043e\u0439\u0434\u0438\u0442\u0435<\/a>, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430.<\/span><!--]--><\/div>\n<\/div>\n<\/div>\n<p><!--[--><\/p>\n<div class=\"tm-article-poll__header\">\u0421 \u043a\u0430\u043a\u043e\u0439 \u0441\u0430\u043c\u043e\u0439 \u0440\u0430\u043d\u043d\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 php \u0432\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0438?<\/div>\n<div class=\"tm-article-poll__answers\"><!--[--><\/p>\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent\">1.58% <\/span><span class=\"tm-article-poll__answer-label\">PHP\/FI 1\/2<\/span><span class=\"tm-article-poll__answer-votes\">3<\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress\" style=\"width: 1.58%\"><\/div>\n<\/div>\n<\/div>\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent\">24.74% <\/span><span class=\"tm-article-poll__answer-label\">PHP3<\/span><span class=\"tm-article-poll__answer-votes\">47<\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress\" style=\"width: 24.74%\"><\/div>\n<\/div>\n<\/div>\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent\">31.58% <\/span><span class=\"tm-article-poll__answer-label\">PHP4<\/span><span class=\"tm-article-poll__answer-votes\">60<\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress\" style=\"width: 31.58%\"><\/div>\n<\/div>\n<\/div>\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent tm-article-poll__answer-percent_winning\">34.74% <\/span><span class=\"tm-article-poll__answer-label\">PHP5<\/span><span class=\"tm-article-poll__answer-votes\">66<\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress tm-article-poll__answer-progress_winning\" style=\"width: 34.74%\"><\/div>\n<\/div>\n<\/div>\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent\">4.74% <\/span><span class=\"tm-article-poll__answer-label\">PHP7<\/span><span class=\"tm-article-poll__answer-votes\">9<\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress\" style=\"width: 4.74%\"><\/div>\n<\/div>\n<\/div>\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent\">1.05% <\/span><span class=\"tm-article-poll__answer-label\">PHP8<\/span><span class=\"tm-article-poll__answer-votes\">2<\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress\" style=\"width: 1.05%\"><\/div>\n<\/div>\n<\/div>\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent\">1.58% <\/span><span class=\"tm-article-poll__answer-label\">\u041d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u043b \u0441 php \u043d\u0438\u043a\u043e\u0433\u0434\u0430<\/span><span class=\"tm-article-poll__answer-votes\">3<\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress\" style=\"width: 1.58%\"><\/div>\n<\/div>\n<\/div>\n<p><!--]--><\/div>\n<div class=\"tm-article-poll__stats\"> \u041f\u0440\u043e\u0433\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u043b\u0438 190 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439.   \u0412\u043e\u0437\u0434\u0435\u0440\u0436\u0430\u043b\u0438\u0441\u044c 6 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439. <\/div>\n<p><!--]--><\/div>\n<p><!--]--><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/787250\/\"> https:\/\/habr.com\/ru\/articles\/787250\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"\">\n<div><figcaption>\u041f\u0443\u0442\u044c \u043e\u0442 \u043d\u0430\u0431\u043e\u0440\u0430 CGI-\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u0434\u043e \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u044f\u0437\u044b\u043a\u043e\u0432 \u0432\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438<\/figcaption><\/div>\n<\/figure>\n<h2>\u0418\u0441\u0442\u043e\u0440\u0438\u044f \u0437\u0430\u0440\u043e\u0436\u0434\u0435\u043d\u0438\u044f PHP <\/h2>\n<p>\u0418\u0441\u0442\u043e\u0440\u0438\u044f PHP \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u043d\u0435 \u0441 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u043e\u0433\u043e \u044f\u0437\u044b\u043a\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0430 \u0441 \u043d\u0430\u0431\u043e\u0440\u0430 CGI-\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u043d\u0430 C, \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e\u0433\u043e \u043a\u0430\u043a PHP\/FI 1 (Personal Home Page Tools\/Forms Interpreter). \u041f\u043e\u0437\u0436\u0435, \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0435\u043a\u0442 \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u043b\u0441\u044f \u0432 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432, \u0430\u043a\u0440\u043e\u043d\u0438\u043c PHP \u0441\u0442\u0430\u043b \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043a\u0430\u043a Hypertext Preprocessor. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u0441\u044f \u043a \u0438\u0441\u0442\u043e\u043a\u0430\u043c PHP, \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u044f \u0435\u0433\u043e \u043f\u0435\u0440\u0432\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e, \u0435\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044e \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c.<\/p>\n<p>\u0410\u0432\u0442\u043e\u0440\u043e\u043c PHP \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0420\u0430\u0441\u043c\u0443\u0441 \u041b\u0435\u0440\u0434\u043e\u0440\u0444, \u0441\u043e\u0437\u0434\u0430\u0432\u0448\u0438\u0439 \u0438 \u0432\u044b\u043b\u043e\u0436\u0438\u0432\u0448\u0438\u0439 \u0432 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f PHP\/FI 1 \u0432 \u0438\u044e\u043d\u0435 1995 \u0433\u043e\u0434\u0430. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043e\u043d \u0438 \u043d\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u043b, \u043a\u0430\u043a\u043e\u0435 \u0432\u043b\u0438\u044f\u043d\u0438\u0435 \u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442 \u043e\u043a\u0430\u0436\u0435\u0442 \u043d\u0430 \u043c\u0438\u0440 \u0432\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438. \u0412 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043d\u0435 \u0431\u044b\u043b\u043e \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u0441\u0438\u0441\u0442\u0435\u043c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u0432\u0435\u0440\u0441\u0438\u0439 \u0438 \u0445\u043e\u0441\u0442\u0438\u043d\u0433\u043e\u0432 IT-\u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432. \u0414\u043e \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044f git \u043e\u0441\u0442\u0430\u0432\u0430\u043b\u043e\u0441\u044c 10 \u043b\u0435\u0442, \u0438 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044f \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u0433\u043e \u041f\u041e \u043d\u0435 \u0431\u044b\u043b\u0430 \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0430 \u0432 \u0442\u043e\u043c \u0432\u0438\u0434\u0435, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043c\u044b \u0435\u0435 \u0437\u043d\u0430\u0435\u043c \u0441\u0435\u0439\u0447\u0430\u0441. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0434\u043b\u044f \u0435\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043b\u043e. \u0412\u043f\u0435\u0440\u0432\u044b\u0435 \u0430\u0432\u0442\u043e\u0440 PHP \u0430\u043d\u043e\u043d\u0441\u0438\u0440\u043e\u0432\u0430\u043b \u0441\u0432\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 \u0440\u0430\u0441\u0441\u044b\u043b\u043a\u0438 <em><abbr class=\"habraabbr\" title=\"https:\/\/en.wikipedia.org\/wiki\/Usene -\u00a0\u043f\u0440\u0430\u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0444\u043e\u0440\u0443\u043c\u043e\u0432, \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0441 1980 \u0433\u043e\u0434\u0430\" data-title=\"&lt;p>\u0443\u044e\u0449\u0438\u0439 \u0441 1980 \u0433\u043e\u0434\u0430&#187; data-title=&#187;&lt;p>&lt;a href=&quot;https:\/\/en.wikipedia.org\/wiki\/Usenet&quot;>https:\/\/en.wikipedia.org\/wiki\/Usene&lt;\/a>&amp;nbsp;-&amp;nbsp;\u043f\u0440\u0430\u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0444\u043e\u0440\u0443\u043c\u043e\u0432, \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0441 1980 \u0433\u043e\u0434\u0430&lt;\/p>&#187; data-abbr=&#187;Comp.lang.Newsgroups&#187;>Comp.lang.Newsgroups<\/abbr><\/em>, \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u043d\u043e\u0439 \u0432\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435.<\/p>\n<p>\u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0435\u043a\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u043b\u0441\u044f \u0434\u043b\u044f \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u043d\u0443\u0436\u0434 \u0441 \u0446\u0435\u043b\u044c\u044e \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043b\u0438\u0447\u043d\u044b\u043c \u0432\u0435\u0431-\u0441\u0430\u0439\u0442\u043e\u043c \u0430\u0432\u0442\u043e\u0440\u0430, \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c \u043f\u043e\u0441\u0435\u0449\u0430\u0435\u043c\u043e\u0441\u0442\u044c, \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f\u043e\u043c \u043a \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0443, \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0432\u0435\u0431-\u0444\u043e\u0440\u043c, \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b.<\/p>\n<h2>\u0421\u0431\u043e\u0440\u043a\u0430 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a PHP\/FI 1 \u0441\u043f\u0443\u0441\u0442\u044f \u043f\u043e\u0447\u0442\u0438 30 \u043b\u0435\u0442<\/h2>\n<p>\u0412\u0441\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 PHP, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0441\u0430\u043c\u044b\u0435 \u0440\u0430\u043d\u043d\u0438\u0435, \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 <a href=\"https:\/\/museum.php.net\/\" rel=\"noopener noreferrer nofollow\"><u>Museum of PHP<\/u><\/a>.<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043a\u0430\u0447\u0430\u0435\u043c \u0441\u0430\u043c\u0443\u044e \u043f\u0435\u0440\u0432\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u0438 \u0440\u0430\u0441\u043f\u0430\u043a\u0443\u0435\u043c \u0430\u0440\u0445\u0438\u0432:<\/p>\n<pre><code class=\"bash\">wget https:\/\/museum.php.net\/php1\/php-108.tar.gz -P php1 cd php1 tar -xzvf php-108.tar.gz -C .<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a\u0438\u0435 \u0444\u0430\u0439\u043b\u044b \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u0441\u044f \u0432 \u0430\u0440\u0445\u0438\u0432\u0435:<\/p>\n<details class=\"spoiler\">\n<summary>\u0421\u043f\u0438\u0441\u043e\u043a \u0444\u0430\u0439\u043b\u043e\u0432:<\/summary>\n<div class=\"spoiler__content\">\n<p> php\/phpf.c<br \/> php\/phpl.c<br \/> php\/phplview.c<br \/> php\/phplmon.c<br \/> php\/common.c<br \/> php\/error.c<br \/> php\/post.c<br \/> php\/wm.c<br \/> php\/common.h<br \/> php\/config.h<br \/> php\/subvar.c<br \/> php\/html_common.h<br \/> php\/post.h<br \/> php\/version.h<br \/> php\/wm.h<br \/> php\/Makefile<br \/> php\/README<br \/> php\/License<\/p>\n<\/div>\n<\/details>\n<p>\u0425\u043e\u0442\u044c \u0444\u0430\u0439\u043b\u043e\u0432 \u0438 \u043d\u0435\u043c\u043d\u043e\u0433\u043e, \u043d\u043e \u0435\u0441\u0442\u044c README. \u041e\u0434\u043d\u0430\u043a\u043e \u0435\u0433\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435 \u0441\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443:<\/p>\n<ol>\n<li>\n<p>\u041e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0439\u0442\u0435 \u0444\u0430\u0439\u043b\u044b <code>config.h<\/code> \u0438 <code>Makefile<\/code> \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u0432\u0430\u0448\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439<\/p>\n<\/li>\n<li>\n<p>\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0443: <code>make<\/code><\/p>\n<\/li>\n<li>\n<p>\u0421\u043a\u043e\u043f\u0438\u0440\u0443\u0439\u0442\u0435 CGI-\u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u0432 \u0432\u0430\u0448\u0443 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e CGI. \u0414\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0430 \u0441\u0430\u0439\u0442\u043e\u0432, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0445 NCSA HTTPD, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0430\u0437\u0432\u0430\u0442\u044c \u0438\u0445 filename.cgi \u0438 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432 \u0432\u0430\u0448\u0443 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e ~\/public_html.  <\/p>\n<\/li>\n<li>\n<p>\u042f \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u044d\u0442\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u043f\u043e\u0434 \u0432\u0430\u0448\u0438\u043c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u0430 \u043d\u0435 \u043f\u043e\u0434 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f httpd.   <\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 <a href=\"http:\/\/www.io.org\/~rasmus\" rel=\"noopener noreferrer nofollow\">http:\/\/www.io.org\/~rasmus<\/a> \u0434\u043b\u044f \u043f\u043e\u043b\u043d\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439 \u043f\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435. (\u0414\u0430, \u044f \u043b\u0435\u043d\u0438\u0432. \u041c\u043d\u0435 \u043d\u0435 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u043f\u0438\u0441\u0430\u0442\u044c \u0432\u0441\u0451 \u0434\u0432\u0430\u0436\u0434\u044b.) <\/p>\n<\/li>\n<li>\n<p>E\u0441\u043b\u0438 \u0445\u043e\u0442\u0438\u0442\u0435, \u043f\u043e\u0434\u043f\u0438\u0448\u0438\u0442\u0435\u0441\u044c \u043d\u0430 \u0441\u043f\u0438\u0441\u043e\u043a \u0440\u0430\u0441\u0441\u044b\u043b\u043a\u0438 PHP, \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0432 \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u043e\u0435 \u043f\u0438\u0441\u044c\u043c\u043e \u043d\u0430 \u0430\u0434\u0440\u0435\u0441:<br \/><code>majordomo@kajen.malmo.se<\/code><br \/>\u0441\u043e \u0441\u0442\u0440\u043e\u043a\u043e\u0439:<br \/><code>subscribe php-list <\/code>your_email_address<br \/>\u0432 \u0442\u0435\u043b\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f. <\/p>\n<\/li>\n<\/ol>\n<p>\u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u0441\u0430\u0439\u0442\u0430 <a href=\"http:\/\/www.io.org\/~rasmus\" rel=\"noopener noreferrer nofollow\"><u>http:\/\/www.io.org\/~rasmus<\/u><\/a> \u0443\u0436\u0435 \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442, \u043d\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f\u043c \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442.<\/p>\n<p>\u0412 \u0444\u0430\u0439\u043b\u0435 config.h \u0435\u0441\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u044b \u043f\u0440\u0435\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430:<\/p>\n<pre><code class=\"cpp\">#define ROOTDIR \"~\/html\" \/\/ \u043a\u043e\u0440\u043d\u0435\u0432\u0430\u044f \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f #define HTML_DIR \".\" \/\/ \u043f\u0430\u043f\u043a\u0430 \u0441 html \u0444\u0430\u0439\u043b\u0430\u043c\u0438 #define LOGDIR \".\" \/\/ \u043f\u0430\u043f\u043a\u0430 \u0434\u043b\u044f \u043b\u043e\u0433-\u0444\u0430\u0439\u043b\u043e\u0432 #define ACCDIR \".\" \/\/ \u043f\u0430\u043f\u043a\u0430 \u0441 \u0444\u0430\u0439\u043b\u0430\u043c\u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 #define NOACCESS \"NoAccess.html\" \/\/ \u0444\u0430\u0439\u043b \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430<\/code><\/pre>\n<p>\u0412 Makefile \u043f\u0440\u043e\u0441\u0442\u043e \u0443\u043a\u0430\u0436\u0435\u043c \u0441\u0431\u043e\u0440\u043a\u0443 \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u043e\u0442\u043b\u0430\u0434\u043a\u0438 \u0438 \u0434\u0435\u0431\u0430\u0433-\u043c\u043e\u0434 \u0434\u043b\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430:<\/p>\n<pre><code class=\"cmake\">... # Generic compiler options CFLAGS= -g -O2 -Wall -DDEBUG $(OPTIONS) #CFLAGS =-O2 $(OPTIONS) ...<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <code>make<\/code> \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442 4 CGI \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b:<\/p>\n<pre><code class=\"bash\">make ... ls | grep \".cgi\" phpf.cgi phpl.cgi phplmon.cgi phplview.cgi<\/code><\/pre>\n<p>\u041d\u0430 \u0434\u0430\u043d\u043d\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e, \u0437\u0430 \u0447\u0442\u043e \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u043a\u0430\u0436\u0434\u0430\u044f \u0438\u0437 \u043d\u0438\u0445. \u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f CGI \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440. \u0412 1995 \u0433\u043e\u0434\u0443 \u0441\u0430\u043c\u044b\u043c \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u043c \u0431\u044b\u043b NCSA HTTPd, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432 \u0442\u043e\u043c \u0436\u0435 \u0433\u043e\u0434\u0443 \u0441\u0442\u0430\u043b \u043e\u0441\u043d\u043e\u0432\u043e\u0439 \u0434\u043b\u044f Apache HTTP Server. \u041e\u0434\u043d\u0430\u043a\u043e, \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e CGI \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043d\u0430 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u043c PHP.<\/p>\n<h2>CGI \u0412\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440 \u0434\u043b\u044f PHP\/FI \u043d\u0430 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u043c PHP<\/h2>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0441\u043f\u0440\u0430\u0432\u043a\u0430 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 CGI. CGI (Common Gateway Interface) \u2014 \u044d\u0442\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u043d\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0432\u043d\u0435\u0448\u043d\u0438\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430\u043c \u0438\u043b\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u0430\u043c, \u0430 \u0437\u0430\u0442\u0435\u043c \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e. \u042d\u0442\u043e \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446 \u0438 \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0435 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c. \u0414\u0430\u043d\u043d\u044b\u0439 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442 \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 1990-\u0445 \u0438 \u0431\u044b\u043b \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u0435\u043d \u0434\u043e \u043d\u0430\u0447\u0430\u043b\u0430 2000-\u0445 \u0433\u043e\u0434\u043e\u0432.<\/p>\n<p><strong>\u0411\u0430\u0437\u043e\u0432\u0430\u044f \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f CGI:<\/strong>  <\/p>\n<ul>\n<li>\n<p><strong>\u041c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0417\u0430\u043f\u0440\u043e\u0441\u0430<\/strong>: \u0412\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u0435\u0442 CGI-\u0441\u043a\u0440\u0438\u043f\u0442\u044b \u043b\u0438\u0431\u043e \u043f\u043e \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u043c\u0443 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0443 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <code>\/cgi-bin\/<\/code>), \u043b\u0438\u0431\u043e \u043f\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044e \u0444\u0430\u0439\u043b\u0430 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <code>.cgi<\/code> \u0438\u043b\u0438 <code>.pl<\/code>). \u041a\u043e\u0433\u0434\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0442\u0430\u043a\u043e\u0439 \u0440\u0435\u0441\u0443\u0440\u0441, \u043e\u043d \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0441\u043a\u0440\u0438\u043f\u0442 \u0432\u043c\u0435\u0441\u0442\u043e \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0444\u0430\u0439\u043b \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0443.<\/p>\n<\/li>\n<li>\n<p><strong>\u041f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u0414\u0430\u043d\u043d\u044b\u0445<\/strong>: \u0414\u0430\u043d\u043d\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u0443 \u0447\u0435\u0440\u0435\u0437 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0441\u0440\u0435\u0434\u044b (environment variables) \u0438 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0432\u0432\u043e\u0434 (stdin), \u0430 \u0432\u044b\u0432\u043e\u0434 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 (stdout) \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u0443, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0435\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e.<\/p>\n<\/li>\n<li>\n<p><strong>\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0437\u0430\u043f\u0440\u043e\u0441\u0430:<\/strong> CGI-\u0441\u043a\u0440\u0438\u043f\u0442\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u044e\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0435 \u0447\u0435\u0440\u0435\u0437 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0441\u0440\u0435\u0434\u044b. \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0437 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445:<\/p>\n<ul>\n<li>\n<p><code>QUERY_STRING<\/code>: \u0441\u0442\u0440\u043e\u043a\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u0430\u044f \u0432 URL \u043f\u043e\u0441\u043b\u0435 \u0437\u043d\u0430\u043a\u0430 <code>?<\/code>.<\/p>\n<\/li>\n<li>\n<p><code>REQUEST_METHOD<\/code>: \u043c\u0435\u0442\u043e\u0434 HTTP \u0437\u0430\u043f\u0440\u043e\u0441\u0430 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <code>GET<\/code> \u0438\u043b\u0438 <code>POST<\/code>).<\/p>\n<\/li>\n<li>\n<p><code>CONTENT_TYPE<\/code> \u0438 <code>CONTENT_LENGTH<\/code>: \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0442\u0435\u043b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u0430\u044f \u0434\u043b\u044f \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0442\u0438\u043f\u0430 POST.<\/p>\n<\/li>\n<li>\n<p><code>SCRIPT_NAME<\/code> \u0438 <code>PATH_INFO<\/code>: \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0442\u043e\u043c, \u043a\u0430\u043a\u043e\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u0431\u044b\u043b \u0432\u044b\u0437\u0432\u0430\u043d, \u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0443\u0442\u044c, \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442\u0443.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<ul>\n<li>\n<p><strong>\u0412\u0432\u043e\u0434<\/strong>: \u0414\u043b\u044f \u043c\u0435\u0442\u043e\u0434\u0430 <code>GET<\/code>, \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 <code>QUERY_STRING<\/code>. \u0414\u043b\u044f <code>POST<\/code> \u2014 \u0434\u0430\u043d\u043d\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0447\u0438\u0442\u0430\u044e\u0442\u0441\u044f \u0438\u0437 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e \u0432\u0432\u043e\u0434\u0430.<\/p>\n<\/li>\n<li>\n<p><strong>\u0412\u044b\u0432\u043e\u0434<\/strong>: CGI-\u0441\u043a\u0440\u0438\u043f\u0442 \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438 \u043e\u0442\u0432\u0435\u0442\u0430 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <code>Content-Type<\/code>), \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043f\u0443\u0441\u0442\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430, \u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0442\u043e\u043c \u0442\u0435\u043b\u043e \u043e\u0442\u0432\u0435\u0442\u0430.<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043b\u044e\u0441\u044b \u0442\u0430\u043a\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u044e\u0442\u0441\u044f \u0432 \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u0435: \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0432\u043d\u0435\u0448\u043d\u044e\u044e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u0438 \u043e\u0442\u0434\u0430\u0435\u0442 \u043a\u043b\u0438\u0435\u043d\u0442\u0443 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043a\u0430\u043a \u0435\u0441\u0442\u044c, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0435 \u0432\u0430\u0436\u043d\u043e \u043d\u0430 \u043a\u0430\u043a\u043e\u043c \u044f\u0437\u044b\u043a\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d CGI \u0441\u043a\u0440\u0438\u043f\u0442.<\/p>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u043c \u043c\u0438\u043d\u0443\u0441\u043e\u043c \u0436\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u0447\u0442\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0435\u043c\u043a\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0435\u0439.<\/p>\n<p><strong>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043d\u0430 PHP<\/strong><\/p>\n<p>\u0412\u0441\u044f \u043e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u043b\u043e\u0433\u0438\u043a\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0431\u0443\u0434\u0435\u0442 \u0441\u0442\u0440\u043e\u0438\u0442\u044c\u0441\u044f \u0432\u043e\u043a\u0440\u0443\u0433 \u0444\u0443\u043d\u043a\u0446\u0438\u0438<a href=\"https:\/\/www.php.net\/manual\/ru\/function.proc-open.php\" rel=\"noopener noreferrer nofollow\"> <u>proc_open<\/u><\/a>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0432\u043d\u0435\u0448\u043d\u044e\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443, \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u044f \u0435\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0441\u0440\u0435\u0434\u044b, \u0438 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u044b \u0432\u0432\u043e\u0434\u0430\/\u0432\u044b\u0432\u043e\u0434\u0430.<\/p>\n<pre><code class=\"php\">&lt;?php  $port = 8080; $address = '127.0.0.1';  \/**  * \u041f\u0430\u0440\u0441\u0438\u043c \u0437\u0430\u043f\u0440\u043e\u0441 \u0438 \u0434\u043e\u0441\u0442\u0430\u0435\u043c \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b  * @param $request  * @return array  *\/ function parseRequest($request): array {     $request = explode(\"\\r\\n\\r\\n\", $request);     $headers = explode(\"\\r\\n\", $request[0]);     $body = $request[1] ?? '';     $headerLine = array_shift($headers);     preg_match('\/(GET|POST) (\\\/\\S*) HTTP\\\/1.\\d\/', $headerLine, $matches);     $method = strtolower($matches[1]) ?? '';     $path = $matches[2] ?? '';     $queryParams = parse_url($path);     return [         'method' => $method,         'path' => $queryParams['path'] ?? '',         'query' => $queryParams['query'] ?? '',         'body' => $body,     ]; }  \/** \u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u0432\u044b\u0437\u043e\u0432 cgi \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u043e\u0442\u0432\u0435\u0442\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0443  * @param $client  * @param $request  * @return void  *\/ function handleRequest($client, $request) {     $method = $request['method'];     $path = $request['path'];     $query = $request['query'];     $body = $request['body'];      \/\/ \u041f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u043c \u0442\u043e\u043b\u044c\u043a\u043e get \u0438 post \u0437\u0430\u043f\u0440\u043e\u0441\u044b     if (!in_array($method, ['get', 'post'])) {         echo \"Error: Invalid method\\n\";         socket_write($client, \"HTTP\/1.1 405 Method Not Allowed\\r\\n\\r\\n\");         return;     }      \/\/ \u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0441\u0440\u0435\u0434\u044b \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u043b\u044f PHP\/FI 1     $env = [         'REQUEST_METHOD' => strtoupper($method),         'QUERY_STRING' => $query,         'CONTENT_TYPE' => 'application\/x-www-form-urlencoded',         'CONTENT_LENGTH' => strlen($body)     ];      \/\/ \u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430     $cmd = \".\" . $path;     $params = str_replace('+', ' ', $query);      \/\/ \u0414\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u044b \u0432\u0432\u043e\u0434\u0430 \u0432\u044b\u0432\u043e\u0434\u0430     $descriptors = [         0 => ['pipe', 'r'], \/\/ stdin         1 => ['pipe', 'w'], \/\/ stdout         2 => ['pipe', 'w'], \/\/ stderr     ];      \/\/ \u0417\u0430\u043f\u0443\u0441\u043a \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430     $process = proc_open($cmd . ' ' . $params, $descriptors, $pipes, '.', $env);     if (is_resource($process)) {         \/\/ \u0417\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0442\u0435\u043b\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0432 stdin         if($body) {             fwrite($pipes[0], $body);         }         fclose($pipes[0]);          $output = stream_get_contents($pipes[1]);         $errors = stream_get_contents($pipes[2]);         if($errors){             var_dump($errors);         }          fclose($pipes[1]);         fclose($pipes[2]);          proc_close($process);          \/\/ \u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u043a\u043b\u0438\u0435\u043d\u0442\u0443 \u043e\u0442\u0432\u0435\u0442         $statusCode = strpos($output, 'Location:') !== false ? '302 Found' : '200 OK';         $response = \"HTTP\/1.1 {$statusCode}\\r\\n{$output}\";         socket_write($client, $response);     } }  $socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); socket_set_option($socket, SOL_SOCKET, SO_REUSEADDR, 1); socket_bind($socket, $address, $port); socket_listen($socket);  echo \"\u0421\u0435\u0440\u0432\u0435\u0440 \u0437\u0430\u043f\u0443\u0449\u0435\u043d http:\/\/$address:$port\\n\";  while (true) {     $client = socket_accept($socket);     $request = socket_read($client, 1024);     $parsedRequest = parseRequest($request);      handleRequest($client, $parsedRequest);      socket_close($client); }  socket_close($socket);  ?> <\/code><\/pre>\n<p>GET-\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b PHP\/FI 1 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043d\u0435 \u0447\u0435\u0440\u0435\u0437 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0441\u0440\u0435\u0434\u044b QUERY_STRING, \u0430 \u043a\u0430\u043a \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b.<\/p>\n<h2>\u0410\u043d\u0430\u043b\u0438\u0437 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430<\/h2>\n<p><strong>phpl.cgi<\/strong><\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u0414\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 phpl.cgi<\/figcaption><\/div>\n<\/figure>\n<p>phpl.cgi \u00a0&#8212; \u043e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433\u043e\u043c html \u0441\u0442\u0440\u0430\u043d\u0438\u0446, \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0435\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435\u043c \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438 \u043f\u043e\u0441\u0435\u0449\u0435\u043d\u0438\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446. \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0438\u0449\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0448\u0435\u043d\u043d\u044b\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u044b\u043b \u0443\u043a\u0430\u0437\u0430\u043d \u0432 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0435 HTML_DIR \u0444\u0430\u0439\u043b\u0430 config.h, \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0444\u0430\u0439\u043b\u0430 All.acc \u0438\u043b\u0438 \u043e\u0434\u043d\u043e\u0438\u043c\u0435\u043d\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0448\u0435\u043d\u043d\u043e\u043c\u0443 \u0444\u0430\u0439\u043b\u0443 \u0441 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435\u043c .acc, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f index.html \u044d\u0442\u043e index.acc. All.acc \u0438\u043c\u0435\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0438\u0439 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442, \u0438 \u0435\u0433\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043d\u0435 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442\u0441\u044f \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0444\u0430\u0439\u043b\u0430\u043c\u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430.<\/p>\n<p>\u0424\u043e\u0440\u043c\u0430\u0442 \u0444\u0430\u0439\u043b\u0430 \u043d\u0435\u043c\u043d\u043e\u0433\u043e<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-365625","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/365625","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=365625"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/365625\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=365625"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=365625"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=365625"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}