M
M
Maxim2018-06-05 21:33:39
Yii
Maxim, 2018-06-05 21:33:39

Yii api rest - why empty response?

Hello! I haven’t quite figured out the api rest yet, I’m trying to connect to the project. Something does not work.
The api folder lies in the cortex along with backend, frontend. In php, the storm issues "Response body is empty" it turns out that something was not connected. But what and how I can not understand. Please help or point me in the right direction. I use the API, not in the module!
Debug and everything else does not work. index.php does not output even In index.phpecho '123';

<?php
defined('YII_DEBUG') or define('YII_DEBUG', true);
defined('YII_ENV') or define('YII_ENV', 'dev');

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

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

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

htaccess
RewriteCond %{REQUEST_URI} ^/(api)
    RewriteRule ^(.*)$ api/web/index.php [L]

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Timofeev, 2018-06-05
@myks92

point in the right direction

1. go to the debug panel
2. give the code, specifically the action that it returned

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question