0

i cant get the kohana aplication working.

Server specs: ubuntu 14.04, nginx, php7.0-fpm

I have the following structure:

build: (static website) ,server: (php-kohana application)

|-- build
|   |-- fonts
|   |-- images
|   |-- index.html
|   |-- scripts
|   `-- styles
|-- server
|   `-- cms
|       |-- application
|       |-- database
|       |-- index.php
|       |-- install.php.bkp
|       |-- media
|       |-- modules
|       |-- system
|       `-- vendor

And the following nginx conf:

server {
listen 80 default_server;
listen [::]:80 default_server;

index index.php index.html index.htm index.nginx-debian.html;

root /srv/www/build/;
location = /{
}
location /server/cms/{
    alias /srv/www/server/cms/;
    try_files $uri $uri/ =404;

}

location ~ \.php$ {
    include snippets/fastcgi-php.conf;
    fastcgi_pass unix:/run/php/php7.0-fpm.sock;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include fastcgi_params;
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    #try_files $uri =404;
}

location ~ /\.ht {
    deny all;
}

}

When i access / i can see the static website,

but when i access /server/cms/ i dont see any errors, only a blank page, no logs in /var/log/nginx/error.log

What can i be missing, why i am not getting any errors?

0

Your PHP location block has no directory specified. So, it means that when going to http://www.example.com/index.php, nginx will try to search /srv/www/build/index.php, which does not exist.

I don't know how the Kohana application is designed and how it should be deployed. If you want to show /srv/www/server/cms/index.php when user goes into http://www.example.com/, you need to use this PHP location block:

location ~ \.php$ {
    alias /srv/www/server/cms/;
    include snippets/fastcgi-php.conf;
    fastcgi_pass unix:/run/php/php7.0-fpm.sock;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include fastcgi_params;
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
}

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.