I can't access the Gii interface from my yii framework backend

145 views Asked by At

Someone else has configured my computer and I don't know how. The script to run my application is not in web/index.php but public_html/index.php. I don't know if that makes a difference. The application uses a mysql database and a react front end and is hosted on aws. Here is the code from the public_html/index.php file:

<?php

require(__DIR__ . '/../vendor/autoload.php');

if (file_exists(__DIR__ . '/../.env')) {
    (new \Dotenv\Dotenv(__DIR__ . '/../'))->load();
}

$yii_env = 'test';

switch (getenv('ENVIRONMENT')) {
    case 'local': $yii_env = 'dev';  break;
    case 'qa':    $yii_env = 'test'; break;
    case 'prod':  $yii_env = 'prod'; break;
}

defined('YII_DEBUG') or define('YII_DEBUG', getenv('DEBUG'));
defined('YII_ENV') or define('YII_ENV', $yii_env);

require(__DIR__ . '/../vendor/yiisoft/yii2/Yii.php');
require(__DIR__ . '/../common/config/bootstrap.php');
require(__DIR__ . '/../api/config/bootstrap.php');



$config = yii\helpers\ArrayHelper::merge(
    require(__DIR__ . '/../common/config/main.php'),
    require(__DIR__ . '/../api/config/main.php')
);

$application = new yii\web\Application($config);
$application->run();

How do I access gii?

1

There are 1 answers

1
namdt55555 On

If you're using apache2. Please check to make sure you have ".htaccess" file in public_html/ folder.