Naeem Ali
Naeem Ali

Reputation: 332

YII2 : and Nginx server

i have create a project in yii2 advanced and its work fine in localhost in xampp and i have webhost in Nginx server .. I delete all the files in public_html folder in my website and after that i upload my project in that website when i try it it gives me

The MYDOAMIN.com page isn’t working

MYDOAMIN.com is currently unable to handle this request.

HTTP ERROR 500

So is there any configuration or did i forget something to do ?

Upvotes: 1

Views: 1945

Answers (2)

Naeem Ali
Naeem Ali

Reputation: 332

the problem was in php version in the server . it was old version .

Upvotes: 1

user2831723
user2831723

Reputation: 892

You have to conf the nginx as well...

From github

server {
    listen       80; # listen for IPv4
    #listen       [::]:80 ipv6only=on; # listen for IPv6
    server_name  advanced.local;
    root         /path/to/advanced;

    #access_log   off;
    #error_log    /dev/null crit;
    charset      utf-8;
    client_max_body_size  100M;

    location / {
        root  /path/to/advanced/frontend/web;
        try_files  $uri /frontend/web/index.php?$args;
    }

    location ~* \.php$ {
        try_files  $uri /frontend/web$uri =404;
        # check the www.conf file to see if PHP-FPM is listening on a socket or a port
         fastcgi_pass  unix:/run/php-fpm/php-fpm.sock; # listen for socket
         #fastcgi_pass  127.0.0.1:9000; # listen for port
         include  /etc/nginx/fastcgi_params;
         fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
     }

     location ~* \.(htaccess|htpasswd|svn|git) {
        deny all;
     }

     location /admin {
         alias  /path/to/advanced/backend/web;
         try_files  $uri /backend/web/index.php?$args;
    }
}

Upvotes: 0

Related Questions