Answer the question
In order to leave comments, you need to log in
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();
RewriteCond %{REQUEST_URI} ^/(api)
RewriteRule ^(.*)$ api/web/index.php [L]
Answer the question
In order to leave comments, you need to log in
point in the right direction
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question