Yii2 Advanced shows a blank page

I am new to yii2. When I extract the extended yii2 content from the archive with the “base application template”, “Yii 2 with the extended application template” , and when I boot to the server, it shows a blank page.

I checked that yii2 basic is working fine, but only in the case of a preliminary template receiving a blank page. An extended template template is similar:../advanced/frontend/web/index.php?r=site

But getting the error: No input file specified.

on the Apache server, getting this error:

Not Found The requested URL advanced/backend/web/index.php was not found on this server.

I tried installing both from the composer and from the archive, but I get the same thing, and the index file does not exist inside the backend / web / and frontend / web /.

Edit:

Like Jichao , I tried to make a subdomain that points to advanced / backend / web, but still the problem is the same.

Scrrenshot:

enter image description here

+4
source share
1 answer

Add the .htaccessfile to the root directory of your project. You must do this manually after installing yii2. A simple example file .htaccess:

Options -Indexes

<IfModule mod_rewrite.c>
    RewriteEngine on    
    RewriteCond %{REQUEST_URI} !^public
    RewriteRule ^(.*)$ frontend/web/$1 [L]
</IfModule>

# Deny accessing below extensions
<Files ~ "(.json|.lock|.git)">
    Order allow,deny
    Deny  from all
</Files>

# Deny accessing dot files
RewriteRule (^\.|/\.) - [F]
+2
source

All Articles