I have a Yii2 application working in a computer with Debian. Then I tried to run it in another computer with Windows 8 but it doesn’t work.
I copied the entire application folder to Apache’s htdocs folder but when I run it in a browser it shows:
Apache access.log:
::1 - - [12/Jul/2018:09:03:40 -0300] "GET /donaciones-yii/backend/web/site/login HTTP/1.1" 404 235
::1 - - [12/Jul/2018:09:03:40 -0300] "GET /favicon.ico HTTP/1.1" 200 1150
This is the content of the file backend/web/index.php:
<?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 = yiihelpersArrayHelper::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 yiiwebApplication($config))->run();
@rob_006: I don’t have the backend/web/.htaccess file in Debian neither Windows computers:
4
Answers
I solved it disabling pretty URLs.
As per rob006 comment, you should have been added .htaccess file to your web folder that contains the following:
and pretty urls will work.
when run yii in docker container, add to /web/.htaccess
add
sava and exit