N
N
Nikita Reshetnyak2021-08-18 11:36:17
Nginx
Nikita Reshetnyak, 2021-08-18 11:36:17

Site on Yii2 advanced not working after transfer from hosting?

Good day! Transferred the site from hosting to VDS. NGINX is up on VDS and php-fpm 7.4 the site refuses to start, I just can’t understand what is the reason, like the nginx configs are correct according to the php settings, I also didn’t see anything. Help to understand who is not difficult, error texts and config below.

ParseError: syntax error, unexpected end of file in /web/sites/SITE.NAME/www/frontend/views/main/new-index.php:855
Stack trace:
#0 /web/sites/SITE.NAME/www/vendor/yiisoft/yii2/base/View.php(254): yii\base\View->renderPhpFile()
#1 /web/sites/SITE.NAME/www/vendor/yiisoft/yii2/base/View.php(156): yii\base\View->renderFile()
#2 /web/sites/SITE.NAME/www/vendor/yiisoft/yii2/base/Controller.php(384): yii\base\View->render()
#3 /web/sites/SITE.NAME/www/frontend/controllers/MainController.php(37): yii\base\Controller->render()
#4 [internal function]: frontend\controllers\MainController->actionIndex()
#5 /web/sites/SITE.NAME/www/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array()
#6 /web/sites/SITE.NAME/www/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams()
#7 /web/sites/SITE.NAME/www/vendor/yiisoft/yii2/base/Module.php(528): yii\base\Controller->runAction()
#8 /web/sites/SITE.NAME/www/vendor/yiisoft/yii2/web/Application.php(103): yii\base\Module->runAction()
#9 /web/sites/SITE.NAME/www/vendor/yiisoft/yii2/base/Application.php(386): yii\web\Application->handleRequest()
#10 /web/sites/SITE.NAME/www/frontend/web/index.php(19): yii\base\Application->run()
#11 {main}



1. in /web/sites/SITE.NAME/www/frontend/views/main/new-index.phpat line 855
846847848849850851852853854855                                    <form id="form3">
                    <div class="modal_title"><?=\frontend\components\Helpers::GetLanguage('get_consultation_tr')?></div>
                    <input type="text" id="name3" placeholder="<?=\frontend\components\Helpers::GetLanguage('name_tr')?>" required>
                    <input type="text" id="phone3" placeholder="<?=\frontend\components\Helpers::GetLanguage('phone_tr')?>" required>
                    <button><?=\frontend\components\Helpers::GetLanguage('back_call_tr')?></button>
                </form>
            </div>
        </div>
    </div>
</div>                
2. in /web/sites/SITE.NAME/www/vendor/yiisoft/yii2/base/View.php at line 254– yii\base\View::renderPhpFile()
3. in /web/sites/SITE.NAME/www/vendor/yiisoft/yii2/base/View.php at line 156– yii\base\View::renderFile()
4. in /web/sites/SITE.NAME/www/vendor/yiisoft/yii2/base/Controller.php at line 384– yii\base\View::render()
5. in /web/sites/SITE.NAME/www/frontend/controllers/MainController.php at line 37– yii\base\Controller::render()
31323334353637383940414243                                ->all();
        return $this->render('new-index',[
            'partners' => $partners,
            'clients' => $clients,
            'about'=> $about,
            'sections'=> $sections,
            'digits'=> $digits,
        ]);
    }
 
    public function actionSetLanguage()
    {
        if (Yii::$app->session->get('language') == "eng_") {
                
6. frontend\controllers\MainController::actionIndex()
7. in /web/sites/SITE.NAME/www/vendor/yiisoft/yii2/base/InlineAction.php at line 57– call_user_func_array()
8. in /web/sites/SITE.NAME/www/vendor/yiisoft/yii2/base/Controller.php at line 157– yii\base\InlineAction::runWithParams()
9. in /web/sites/SITE.NAME/www/vendor/yiisoft/yii2/base/Module.php at line 528– yii\base\Controller::runAction()
10. in /web/sites/SITE.NAME/www/vendor/yiisoft/yii2/web/Application.php at line 103– yii\base\Module::runAction()
11. in /web/sites/SITE.NAME/www/vendor/yiisoft/yii2/base/Application.php at line 386– yii\web\Application::handleRequest()
12. in /web/sites/SITE.NAME/www/frontend/web/index.php at line 19– yii\base\Application::run()
13141516171819                        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();


server {
    listen 443 ssl http2;
  
  charset utf-8;
    client_max_body_size 128M;
  
    server_name SITE.NAME;
  set $project_root /web/sites/SITE.NAME/www;
  set $fcgi_server 127.0.0.1:9000;
  
  root $project_root/frontend/web;
    index index.php;

    index index.php index.html index.htm;
    access_log /web/sites/SITE.NAME/log/access.log;
    error_log /web/sites/SITE.NAME/log/error.log;

    ssl_certificate		/etc/letsencrypt/live/SITE.NAME/fullchain.pem;
    ssl_certificate_key		/etc/letsencrypt/live/SITE.NAME/privkey.pem;

    location / {
    try_files $uri $uri/ /index.php$is_args$args;
    }
  
  location ^~ /backend {
        rewrite ^/backend(.*)$ /backend/web$1 last;
    }
  
  location ^~ /backend/web {
        root $project_root;

        # uncomment the following, if you want to enable speaking URL in the backend
        #try_files $uri $uri/ /backend/web/index.php$is_args$args;

        location ~ /\.(ht|svn|git) {
            deny all;
        }

        location ~ \.php$ {
            try_files $uri =404;
            include fastcgi_params;
            fastcgi_pass $fcgi_server;
        }
    }

    location ~* ^.+\.(js|css|ttf|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|tar|bz2|pdf|doc|docx|rtf|xls|ppt|mp3)$ {
        #access_log off;
        #log_not_found off;
        #expires 3d; # кеширование статики 3 дня
        try_files $uri =404;
    }
  
  location ~ ^/assets/.*\.php$ {
        deny all;
    }

    location ~ \.php$ {
    fastcgi_pass $fcgi_server;
    include snippets/fastcgi-php.conf;
    }

    location = /favicon.ico {
    log_not_found off;
    access_log off;
    }

    location = /robots.txt {
    allow all;
    log_not_found off;
    access_log off;
    }

    location ~ /\.ht {
    deny all;
    }
  
  location ~* /\. {
        deny all;
    }
}

server {
     listen  443 ssl http2;
     server_name  www.SITE.NAME;
     return 301 https://SITE.NAME$request_uri;
}

server {
    listen 80;
    server_name SITE.NAME;
    root /web/sites/SITE.NAME/www/;
    index index.php index.html index.htm;
    access_log /web/sites/SITE.NAME/log/access.log;
    error_log /web/sites/SITE.NAME/log/error.log;

    client_max_body_size 512M;

    location /nginx-status {
        stub_status on;
        access_log   off;
        allow all;
    }
    location / {
    return 301 https://SITE.NAME$request_uri;
    }
}

server {
     listen  80;
     server_name  www.SITE.NAME;
     client_max_body_size 512M;
     return 301 http://SITE.NAME$request_uri;
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nikita Reshetnyak, 2021-08-18
@trjflash

The problem was PHP's disabled short tags

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question