Deploying basic Yii2 App

I deployed my Yii2 basic application on a shared hosting, but I’m facing this problem:

It happens even when I extract the web directory in the root, it gives "/index.php" instead of "/web/index.php".

But it seems that index.php is read by the server, because when I change (for example) the database config, it gives a db error.

Files access mod are on ‘644’ and directories on ‘755’. show this error:

When I change index.php to ‘777’, the error become on the two paths: (“” and “”)

Inspite of moving web directory to root you can use .htaccess under the web directory that can help you set up easily with any hassle

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule . index.php

You need to read this: