{"id":274310,"date":"2016-02-15T16:14:02","date_gmt":"2016-02-15T13:14:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=274310"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=274310","title":{"rendered":"\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Yii2 \u043d\u0430 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u043c \u0445\u043e\u0441\u0442\u0438\u043d\u0433\u0435"},"content":{"rendered":"<p>       \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Yii2 \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u0432 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0435, \u0430 \u0442\u0430\u043a \u0436\u0435 \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d\u043e \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0430\u0442\u0435\u0439, \u043d\u043e \u044f \u043d\u0435 \u043d\u0430\u0448\u0435\u043b \u0442\u043e\u0433\u043e \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u043e\u043c\u043e\u0433\u043b\u043e \u0431\u044b \u043c\u043d\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u043e\u0442 \u043d\u0430\u0447\u0430\u043b\u0430 \u0438 \u0434\u043e \u043a\u043e\u043d\u0446\u0430. \u0412\u043e \u0432\u0440\u0435\u043c\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u044f \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0432\u043e\u043f\u0440\u043e\u0441\u0430\u043c\u0438, \u043e\u0442\u0432\u0435\u0442\u044b \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u043b\u0438\u0441\u044c \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u043c\u0435\u0441\u0442\u0430\u0445 \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u043e\u0440\u0430\u0445 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430. \u041f\u043e\u0441\u043b\u0435 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043f\u043b\u044f\u0441\u043e\u043a \u0441 \u0431\u0443\u0431\u043d\u0430\u043c\u0438 \u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043b Yii2 \u0442\u0430\u043a \u043a\u0430\u043a \u0445\u043e\u0442\u0435\u043b. \u0421\u0432\u043e\u0439 \u043e\u043f\u044b\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u044f \u0438 \u043e\u043f\u0438\u0448\u0443 \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435, \u0432 \u043d\u0430\u0434\u0435\u0436\u0434\u0435 \u0447\u0442\u043e \u043a\u043e\u043c\u0443-\u0442\u043e \u044d\u0442\u043e \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442 \u0432\u0440\u0435\u043c\u044f \u043f\u043b\u044f\u0441\u043e\u043a \u0438 \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442 \u0436\u0438\u0437\u043d\u044c.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h4>1. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Composer<\/h4>\n<p>  \u0422\u0430\u043a \u043a\u0430\u043a \u043e\u043f\u044b\u0442\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0435 Linux\/Unix \u0443 \u043c\u0435\u043d\u044f \u043d\u0435\u043c\u043d\u043e\u0433\u043e, \u0442\u043e \u043f\u0435\u0440\u0432\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0443\u0436\u0435 \u043f\u0440\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 Composer. \u041d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u044b \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0435\u0440\u0441\u0438\u0439 PHP, \u0438 \u043f\u043e-\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 PHP \u0432\u0435\u0440\u0441\u0438\u0438 5.2.17. \u0410 Composer \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0432\u0435\u0440\u0441\u0438\u044e PHP 5.3.2 \u0438 \u0432\u044b\u0448\u0435. \u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u0431\u044b\u043b\u043e \u0442\u0430\u043a\u0438\u043c:  <\/p>\n<pre><code class=\"bash\">php -r &quot;readfile('https:\/\/getcomposer.org\/installer');&quot; | php5.6 <\/code><\/pre>\n<p>  \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043d\u0435 \u0434\u0430\u044e\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c Composer \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u043c \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0435\u0433\u043e \u0447\u0435\u0440\u0435\u0437 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440 PHP, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u044f \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u044e PHP:  <\/p>\n<pre><code class=\"bash\">php5.6 composer.phar install <\/code><\/pre>\n<p>  \u041f\u0435\u0440\u0432\u044b\u0439 \u0448\u0430\u0433 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d \u2014 Composer \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d. <\/p>\n<h4>2. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Yii2<\/h4>\n<p>  \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0432\u0441\u0451 <a href=\"http:\/\/www.yiiframework.com\/doc-2.0\/guide-start-installation.html\">\u043f\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438<\/a>: \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043f\u043b\u0430\u0433\u0438\u043d composer asset, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 bower \u0438 npm.   <\/p>\n<pre><code class=\"bash\">php5.6 composer.phar global require &quot;fxp\/composer-asset-plugin:~1.1.1&quot; <\/code><\/pre>\n<p>  \u042d\u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e 1 \u0440\u0430\u0437, \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u043c\u043e\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c Yii2 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043c\u0430\u043d\u0434 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u043d\u0438\u0436\u0435.<br \/>  \u0422\u0435\u043f\u0435\u0440\u044c \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u043a\u0430\u043a\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u0448\u0430\u0431\u043b\u043e\u043d\u0430 Yii2 \u0441\u0442\u0430\u0432\u0438\u0442\u044c: Basic \u0438\u043b\u0438 Advanced. Basic \u2014 \u043f\u0440\u043e\u0441\u0442\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0430 \u0432 Advanced \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043d\u0430 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u0443\u044e \u0438 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u0438\u0432\u043d\u0443\u044e \u0447\u0430\u0441\u0442\u044c (frontend \u0438 backend) \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0430 \u0433\u043e\u0442\u043e\u0432\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c (\u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0411\u0414) user.<\/p>\n<h5>2.1. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Yii2 Basic<\/h5>\n<p>  \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443 Basic, \u0442.\u043a. \u043e\u043d\u0430 \u043f\u0440\u043e\u0449\u0435, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u044b:  <\/p>\n<pre><code class=\"bash\">php5.6 composer.phar create-project --prefer-dist yiisoft\/yii2-app-basic mysite <\/code><\/pre>\n<p>  \u0413\u0434\u0435 <code>mysite<\/code> \u2014 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c Yii2, \u043e\u043d \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u043f\u0443\u0441\u0442\u044b\u043c (\u0435\u0441\u043b\u0438 \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u0430 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0431\u044b\u043b \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u043e\u0437\u0434\u0430\u043d \u043f\u043e\u0434\u043a\u0430\u0442\u0430\u043b\u043e\u0433 <code>public_html<\/code>, \u0435\u0433\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u0434\u0430\u043b\u0438\u0442\u044c). Composer \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u0438\u0442\u044c \u043b\u043e\u0433\u0438\u043d-\u043f\u0430\u0440\u043e\u043b\u044c \u043e\u0442 Github (\u0438\u0437-\u0437\u0430 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u043d\u0430 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0443 \u0413\u0438\u0442\u0445\u0430\u0431\u0430).<\/p>\n<p>  \u041d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043b\u0438\u0440\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043e\u0442\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435 \u043f\u0440\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u043e\u0432 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0438 \u0432\u043e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0435. \u0420\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u043c\u044b\u0439 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d \u0442\u0430\u043a, \u0447\u0442\u043e \u0444\u0430\u0439\u043b\u044b \u0441\u0430\u0439\u0442\u043e\u0432 \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u044e\u0442\u0441\u044f \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 <code>mysite\/public_html<\/code>. \u0424\u0430\u0439\u043b\u044b \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 <code>public_html<\/code> \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0438\u0437 \u0432\u0435\u0431\u0430. <\/p>\n<p>  \u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0448\u0430\u0431\u043b\u043e\u043d\u0430 Yii2 Basic \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0444\u0430\u0439\u043b\u043e\u0432 \u0438 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u043c\u0438 \u0438\u0437 \u0432\u0435\u0431\u0430, \u0447\u0442\u043e\u0431\u044b \u00ab\u0437\u0430\u0449\u0438\u0442\u0438\u0442\u044c \u043e\u0442 \u043d\u0435\u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a\u043e\u0434 \u0438 \u0434\u0430\u043d\u043d\u044b\u0435\u00bb, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 <code>basic\/web<\/code> \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043a\u0430\u043a \u0440\u0430\u0437 \u0438 \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u0431\u044b\u0442\u044c \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0435\u0439 \u0432\u0435\u0431 \u0441\u0435\u0440\u0432\u0435\u0440\u0430. \u0414\u043b\u044f \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u00ab\u0441\u0438\u043c\u0432\u043e\u043b\u044c\u043d\u0443\u044e\u00bb \u0441\u0441\u044b\u043b\u043a\u0443:  <\/p>\n<pre><code class=\"bash\">cd mysite ln -s web public_html <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430 <code>basic\/web<\/code> \u2014 \u044d\u0442\u043e \u043d\u0430\u0448 \u0441\u0430\u0439\u0442, \u0430 \u0434\u0440\u0443\u0433\u0438\u0435 \u0444\u0430\u0439\u043b\u044b \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0438\u0437 \u0441\u0435\u0442\u0438.<br \/>  Yii2 Basic \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d, \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u0441\u0430\u0439\u0442 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435.<\/p>\n<h6>2.1.1. \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Yii2 Basic<\/h6>\n<p>  \u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u0444\u0430\u0439\u043b <code>config\/db.php<\/code> \u0438 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043d\u0430 \u0432\u0435\u0440\u043d\u044b\u0435 \u0434\u043b\u044f \u0432\u0430\u0448\u0435\u0439 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445. \u041f\u043e\u0441\u043b\u0435 <code>'charset' =&gt; 'utf8',<\/code> \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u0440\u0435\u0444\u0438\u043a\u0441 \u0442\u0430\u0431\u043b\u0438\u0446 \u0442\u0430\u043a: <code>'tablePrefix' =&gt; 'myprefix_'<\/code> (\u0435\u0441\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0430\u0439\u0442\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u043e\u0434\u043d\u0443 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445).<\/p>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u0441\u0441\u044b\u043b\u043a\u0438, \u043f\u043e-\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u0438\u043c\u0435\u0435\u0442 \u0432\u0438\u0434 <code>\/index.php?r=site%2Fabout<\/code>, \u043f\u0435\u0440\u0435\u0432\u0435\u0434\u0451\u043c \u0435\u0435 \u0432 \u0442\u0430\u043a\u043e\u0439 \u0432\u0438\u0434 <code>\/site\/about<\/code>. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u0430\u0439\u043b <code>web\/.htaccess<\/code> \u0441 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u044b\u043c \u043a\u0430\u043a \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e\u0442 \u0432 <a href=\"http:\/\/www.yiiframework.com\/doc-2.0\/guide-tutorial-shared-hosting.html\">\u043e\u0444. \u0433\u0430\u0439\u0434\u0435<\/a>:  <\/p>\n<pre><code class=\"apache\">Options +FollowSymLinks IndexIgnore *\/*  RewriteEngine on  # if a directory or a file exists, use it directly RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d  # otherwise forward it to index.php RewriteRule . index.php <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440 \u0437\u043d\u0430\u0435\u0442, \u0447\u0442\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043d\u0430 index.php, \u0438 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c index.php \u0432 URL \u043d\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438. \u0414\u0430\u043b\u0435\u0435 \u0432 \u0444\u0430\u0439\u043b\u0435 <code>config\/web.php<\/code> \u0434\u043e\u0431\u0430\u0432\u0438\u043c (\u0438\u043b\u0438 \u0440\u0430\u0441\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u0435\u043c) \u0432 <code>$config = ['components']<\/code> \u043f\u043e\u0441\u043b\u0435 <code>'db' =&gt; require(__DIR__ . '\/db.php'),<\/code> \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0441\u0442\u0440\u043e\u043a\u0438  <\/p>\n<pre><code class=\"php\"> 'urlManager' =&gt; [             'enablePrettyUrl' =&gt; true,             'showScriptName' =&gt; false,             'rules' =&gt; [             ],         ], <\/code><\/pre>\n<p>  enablePrettyUrl \u2014 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u0440\u0430\u0441\u0438\u0432\u044b\u0435 \u0441\u0441\u044b\u043b\u043a\u0438, showScriptName \u2014 \u043d\u0435 \u043f\u0438\u0441\u0430\u0442\u044c \u0438\u043c\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u0430 index.php \u0432 \u0441\u0441\u044b\u043b\u043a\u0435. \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0439\u0442\u0438 \u043d\u0430 \u043d\u0430\u0448 \u0441\u0430\u0439\u0442 \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u0447\u0442\u043e \u043e\u043d \u0443\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043a\u0440\u0430\u0441\u0438\u0432\u044b\u0435 \u0441\u0441\u044b\u043b\u043a\u0438 \u0442\u0438\u043f\u0430 <code>\/site\/about<\/code>.<br \/>  \u041e\u0442\u043b\u0438\u0447\u043d\u043e, \u0441 Yii2 Basic \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c, \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a Advanced.<\/p>\n<h5>2.2. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Yii2 Advanced<\/h5>\n<p>  \u041d\u0430\u0447\u0430\u043b\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e Basic:  <\/p>\n<pre><code class=\"bash\">php5.6 composer.phar create-project --prefer-dist yiisoft\/yii2-app-advanced mysite<\/code><\/pre>\n<p>  Yii2 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d, \u0432 \u0435\u0433\u043e \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 mysite \u043f\u043e\u044f\u0432\u0438\u043b\u0438\u0441\u044c \u0444\u0430\u0439\u043b\u044b \u0438 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0438 Yii2 \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 frontend \u0434\u043b\u044f \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0441\u0430\u0439\u0442\u0430 \u0438 backend \u0434\u043b\u044f \u0430\u0434\u043c\u0438\u043d\u043a\u0438. \u041e\u0434\u043d\u0430\u043a\u043e \u0432 frontend\/web \u043d\u0435\u0442 \u0444\u0430\u0439\u043b\u0430 index.php, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u0430\u043b\u0435\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 init \u0434\u043b\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u0438 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0441\u0438\u043c\u0432\u043e\u043b\u044c\u043d\u0443\u044e \u0441\u0441\u044b\u043b\u043a\u0443 \u0434\u043b\u044f frontend:  <\/p>\n<pre><code class=\"bash\">cd mysite php5.6 init ln -s frontend\/web public_html <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043f\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c\u0443 \u0430\u0434\u0440\u0435\u0441\u0443 \u0441\u0430\u0439\u0442\u0430. \u0414\u0430\u043b\u0435\u0435 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u0431\u0435\u043a\u0435\u043d\u0434:  <\/p>\n<pre><code class=\"bash\">cd frontend\/web ln -s ..\/..\/backend\/web admin <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0431\u0435\u043a\u0435\u043d\u0434 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 <code>\/admin<\/code>.<br \/>  \u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u043a\u0440\u0430\u0441\u0438\u0432\u044b\u0435 \u0430\u0434\u0440\u0435\u0441\u0430 \u0432\u043e \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434\u0435:  <\/p>\n<ol>\n<li>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0432 <code>\/frontend\/web<\/code> \u0442\u0430\u043a\u043e\u0439 \u0436\u0435 <code>.htaccess<\/code> \u043a\u0430\u043a \u0438 \u0432 \u0448\u0430\u0431\u043b\u043e\u043d\u0435 Basic<\/li>\n<li>\u0412 \u043a\u043e\u043d\u0444\u0438\u0433\u0435 <code>\/frontend\/config\/main.php<\/code> \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435<\/li>\n<\/ol>\n<p>  \u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u043c \u0434\u043b\u044f \u0431\u0435\u043a\u0435\u043d\u0434\u0430. \u041f\u043e\u043f\u0443\u0442\u043d\u043e \u0437\u0430\u043c\u0435\u0447\u0430\u0435\u043c \u0447\u0442\u043e \u0444\u0430\u0439\u043b\u0430 <code>db.php<\/code> \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 <code>config<\/code> \u043d\u0435\u0442.<br \/>  \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 Advanced \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432 <code>common\/config\/main-local.php<\/code>, \u0442\u0430\u043c \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0442\u043e\u0436\u0435 \u0447\u0442\u043e \u0438 \u0432 <code>db.php<\/code> \u0432 Basic. \u041f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u043c \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044e:   <\/p>\n<pre><code class=\"bash\">php5.6 yii migrate <\/code><\/pre>\n<p>  \u0412 \u0411\u0414 \u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b migration \u0438 user.<\/p>\n<p>  \u0423\u0440\u0430! Yii2 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d, \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d \u0438 \u0433\u043e\u0442\u043e\u0432 \u043a \u0440\u0430\u0431\u043e\u0442\u0435.<\/p>\n<h4>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0438<\/h4>\n<p>  <a href=\"https:\/\/getcomposer.org\/doc\/00-intro.md\">Introduction \u2014 Composer<\/a><br \/>  <a href=\"http:\/\/www.yiiframework.com\/doc-2.0\/guide-index.html\">The Definitive Guide to Yii 2.0 (\u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0433\u0430\u0439\u0434 \u043f\u043e Yii2 \u043d\u0430 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u043e\u043c)<\/a><br \/>  <a href=\"http:\/\/nix-tips.ru\/yii2-api-guides\/guide-ru-README.html\">\u041f\u043e\u043b\u043d\u043e\u0435 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e \u043f\u043e Yii 2.0 (\u0440\u0443\u0441\u0441\u043a\u0438\u0439 \u043f\u0435\u0440\u0435\u0432\u043e\u0434)<\/a><br \/>  <a href=\"https:\/\/github.com\/yiisoft\/yii2-app-advanced\/blob\/master\/docs\/guide\/start-installation.md\">Installation Yii2 Advanced<\/a><br \/>  <a href=\"http:\/\/vegibit.com\/how-to-install-the-advanced-template-in-yii2\/\">How To Install The Advanced Template In Yii2<\/a>               <\/p>\n<div class=\"clear\"><\/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:\/\/habrahabr.ru\/post\/277209\/\"> https:\/\/habrahabr.ru\/post\/277209\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>       \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Yii2 \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u0432 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0435, \u0430 \u0442\u0430\u043a \u0436\u0435 \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d\u043e \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0430\u0442\u0435\u0439, \u043d\u043e \u044f \u043d\u0435 \u043d\u0430\u0448\u0435\u043b \u0442\u043e\u0433\u043e \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u043e\u043c\u043e\u0433\u043b\u043e \u0431\u044b \u043c\u043d\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u043e\u0442 \u043d\u0430\u0447\u0430\u043b\u0430 \u0438 \u0434\u043e \u043a\u043e\u043d\u0446\u0430. \u0412\u043e \u0432\u0440\u0435\u043c\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u044f \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0432\u043e\u043f\u0440\u043e\u0441\u0430\u043c\u0438, \u043e\u0442\u0432\u0435\u0442\u044b \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u043b\u0438\u0441\u044c \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u043c\u0435\u0441\u0442\u0430\u0445 \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u043e\u0440\u0430\u0445 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430. \u041f\u043e\u0441\u043b\u0435 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043f\u043b\u044f\u0441\u043e\u043a \u0441 \u0431\u0443\u0431\u043d\u0430\u043c\u0438 \u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043b Yii2 \u0442\u0430\u043a \u043a\u0430\u043a \u0445\u043e\u0442\u0435\u043b. \u0421\u0432\u043e\u0439 \u043e\u043f\u044b\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u044f \u0438 \u043e\u043f\u0438\u0448\u0443 \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435, \u0432 \u043d\u0430\u0434\u0435\u0436\u0434\u0435 \u0447\u0442\u043e \u043a\u043e\u043c\u0443-\u0442\u043e \u044d\u0442\u043e \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442 \u0432\u0440\u0435\u043c\u044f \u043f\u043b\u044f\u0441\u043e\u043a \u0438 \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442 \u0436\u0438\u0437\u043d\u044c.  <\/p>\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-274310","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/274310","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=274310"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/274310\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=274310"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=274310"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=274310"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}