vagrant сконфигурирован с помощью puphpet.com. вот файл конфига https://yadi.sk/d/HqOVISLzdyUMv
файл конфига
Код: Выделить всё
$config = [
'id' => 'app-backend',
'basePath' => dirname(__DIR__),
'controllerNamespace' => 'backend\controllers',
'bootstrap' => ['log'],
'components' => [
'request' => [
// !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
'cookieValidationKey' => 'asd'
],
'cache' => [
'class' => 'yii\caching\FileCache',
],
'user' => [
'identityClass' => 'backend\modules\users\models\Users',
],
'urlManager' => [
'enablePrettyUrl' => true,
'showScriptName' => false
],
'errorHandler' => [
'errorAction' => 'site/error',
],
'mailer' => [
'class' => 'yii\swiftmailer\Mailer',
// send all mails to a file by default. You have to set
// 'useFileTransport' to false and configure a transport
// for the mailer to send real emails.
'useFileTransport' => true,
],
'log' => [
'traceLevel' => YII_DEBUG ? 3 : 0,
'targets' => [
[
'class' => 'yii\log\FileTarget',
'levels' => ['error', 'warning'],
],
],
]
],
'vendorPath' => dirname(dirname(__DIR__)) . '/vendor',
'extensions' => require(__DIR__ . '/../../vendor/yiisoft/extensions.php')
];
if (YII_ENV_DEV) {
// configuration adjustments for 'dev' environment
$config['bootstrap'][] = 'debug';
$config['modules']['debug'] = 'yii\debug\Module';
$config['bootstrap'][] = 'gii';
$config['modules']['gii'] = 'yii\gii\Module';
}
return $config;
Код: Выделить всё
<?php
defined('YII_DEBUG') or define('YII_DEBUG', true);
defined('YII_ENV') or define('YII_ENV', 'dev');
require('/var/www/app/vendor/autoload.php');
require('/var/www/app/vendor/yiisoft/yii2/Yii.php');
$config = require('/var/www/app/backend/config/main.php');
$application = new yii\web\Application($config);
$application->run();
Код: Выделить всё
<IfModule mod_rewrite.c>
# Make sure directory listing is disabled
Options +FollowSymLinks -Indexes
RewriteEngine on
# NOTICE: If you get a 404 play with combinations of the following commented out lines
#AllowOverride All
#RewriteBase /wherever/fuel/is
# Restrict your site to only one domain
# !important USE ONLY ONE OPTION
# Option 1: To rewrite "www.domain.com -> domain.com" uncomment the following lines.
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
# Option 2: To rewrite "domain.com -> www.domain.com" uncomment the following lines.
#RewriteCond %{HTTPS} !=on
#RewriteCond %{HTTP_HOST} !^www\..+$ [NC]
#RewriteCond %{HTTP_HOST} (.+)$ [NC]
#RewriteRule ^(.*)$ http://www.%1/$1 [R=301,L]
# Remove index.php from URL
RewriteCond %{HTTP:X-Requested-With} !^XMLHttpRequest$
RewriteCond %{THE_REQUEST} ^[^/]*/index\.php [NC]
RewriteRule ^index\.php(.*)$ $1 [R=301,NS,L]
# Send request via index.php (again, not if its a real file or folder)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# deal with php5-cgi first
<IfModule mod_fcgid.c>
RewriteRule ^(.*)$ index.php?/$1 [QSA,L]
</IfModule>
<IfModule !mod_fcgid.c>
# for normal Apache installations
<IfModule mod_php5.c>
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
# for Apache FGCI installations
<IfModule !mod_php5.c>
RewriteRule ^(.*)$ index.php?/$1 [QSA,L]
</IfModule>
</IfModule>
</IfModule>
Код: Выделить всё
exception 'yii\base\InvalidRouteException' with message 'Unable to resolve the request "site/error".' in /var/www/app/vendor/yiisoft/yii2/base/Module.php:461
Stack trace:
#0 /var/www/app/vendor/yiisoft/yii2/web/ErrorHandler.php(80): yii\base\Module->runAction('site/error')
#1 /var/www/app/vendor/yiisoft/yii2/base/ErrorHandler.php(95): yii\web\ErrorHandler->renderException(Object(yii\web\NotFoundHttpException))
#2 [internal function]: yii\base\ErrorHandler->handleException(Object(yii\web\NotFoundHttpException))
#3 {main}
Previous exception:
exception 'yii\base\InvalidRouteException' with message 'Unable to resolve the request "".' in /var/www/app/vendor/yiisoft/yii2/base/Module.php:461
Stack trace:
#0 /var/www/app/vendor/yiisoft/yii2/web/Application.php(83): yii\base\Module->runAction('', Array)
#1 /var/www/app/vendor/yiisoft/yii2/base/Application.php(375): yii\web\Application->handleRequest(Object(yii\web\Request))
#2 /var/www/api.app.dev/index.php(12): yii\base\Application->run()
#3 {main}
Next exception 'yii\web\NotFoundHttpException' with message 'Unable to resolve the request "".' in /var/www/app/vendor/yiisoft/yii2/web/Application.php:95
Stack trace:
#0 /var/www/app/vendor/yiisoft/yii2/base/Application.php(375): yii\web\Application->handleRequest(Object(yii\web\Request))
#1 /var/www/api.app.dev/index.php(12): yii\base\Application->run()
#2 {main}