N
N
Nikolai Novosad2016-01-08 12:33:09
Yii
Nikolai Novosad, 2016-01-08 12:33:09

Yii2 No input file specified on hosting?

Hello. On local, the application on yii2 advanced works fine. But after the transfer to hostinger.ru, the transition to the backend 'broke'.
After authorization on the backend, the admin has the choice to proceed to editing the necessary table, which are generated via gii.

<ul class="list-admin">
            <li> <a href="index.php/catalog"> Каталог </a> </li>
            <li> <a href="index.php/section"> Категория </a> </li>
            <li> <a href="index.php/product"> Продукт </a> </li>
            <li> <a href="index.php/news"> Новости </a> </li>
            <li> <a href="index.php/review"> Отзывы </a> </li>
        </ul>

Here is the .htaccess code in backend/web/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php

Here is the backend/config/main.php code
<?php
$params = array_merge(
    require(__DIR__ . '/../../common/config/params.php'),
    require(__DIR__ . '/../../common/config/params-local.php'),
    require(__DIR__ . '/params.php'),
    require(__DIR__ . '/params-local.php')
);

return [
    'id' => 'app-backend',
    'language' => 'ru-RU',
    'basePath' => dirname(__DIR__),
    'controllerNamespace' => 'backend\controllers',
    'bootstrap' => ['log'],
    'modules' => [],
    'components' => [
        'user' => [
            'identityClass' => 'common\models\User',
            'enableAutoLogin' => true,
        ],
        'log' => [
            'traceLevel' => YII_DEBUG ? 3 : 0,
            'targets' => [
                [
                    'class' => 'yii\log\FileTarget',
                    'levels' => ['error', 'warning'],
                ],
            ],
        ],
        'errorHandler' => [
            'errorAction' => 'site/error',
        ],
         'urlManager' => [
            'enablePrettyUrl' => true,
            'showScriptName' => false,
            //'suffix' => '.html',
            'rules' => [
                '' => 'site/index',
                
                
                '<action>'=>'site/<action>',
            ],
        ], 
         'assetManager' => [
             'basePath' => '@webroot/assets',
             'baseUrl' => '@web/assets'
        ],  
        'request' => [
            'baseUrl' => '/admin'
        ]
    ],
    'params' => $params,
];

When I click on the link, let's say 'Directory' I get No input file specified.
Need to change .htaccess or the links themselves? Although I tried different links, but then 404.
Thanks in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor, 2016-01-15
@lxShaDoWxl

Generate a link through the Html helper
and see what happens

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question