4
votes

I am new in yii2, When I extract yii2 advanced content from an archive with "basic application template", "Yii 2 with advanced application template" and when I upload on server, it's showing blank page.

I checked yii2 basic it's working fine but only in case of advance template getting blank page. The advanced template url is like: ../advanced/frontend/web/index.php?r=site

But getting Error: No input file specified.

on Apache Server, getting this error:

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

I tried installing from composer as well as from an archive but getting same and no index file exists inside backend/web/ and frontend/web/.

Edit:

As Jichao suggested, I tried making subdomain which points to the advanced/backend/web, But still the problem is same.

Scrrenshot:

enter image description here

1
maybe make a subdomain like backend.domain.com and point it to the root directory advanced/backend/web could helps. the new access url should backend.domain.com.Jichao
@Jichao I tried making subdomain as u suggested but still problem is same.San05KITS
The problem is that apache can't find index.php in the directory that you pointed the host to. Check where you bound the domain, then go and check if there is index.php there. Upload other file (smth like 1.txt) to that dir to make sure that apache is working properly. Try something, move.Viacheslav

1 Answers

2
votes

Add .htaccess file into the root directory of your project. You should do it manually after yii2 installation. Simple example of the .htaccess file:

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]