Welcome Guest, Not a member yet? Register   Sign In
Inherited 2.0.2 site and php-fpm 5.6 + NginX
#1
Sad 

Dear Forum,

Please assist me in an issue I'm having with an old website made with Codeigniter. From the code I've found out, the codeigniters CI_VERSION is 2.0.2 and it is a website ment to be a facebook app.  
I've set up the database with a user and imported the old data into it. 

The server specifications are:
  • Nginx: 1.8.0
  • PHP + PHP-FPM: 5.6.20
  • MySQL: 5.7.15

The PHP is running on port 9000 and since I have mupltiple websites activated on this server I know it is working properly. 

Here is my NginX configuration. Please note that the part of port 80, is not really relevant since the site automaticly get's forwarded to https (I have no idea how, probably in the websites code since it is a Facebook app, it needs to run on https.)


Code:
server {
        listen 80;
        server_name website.company.hu;
        root /var/www/hu.company.website;

index index.php;

        access_log  /var/log/nginx/hu.company.website/access-80.log;
        error_log  /var/log/nginx/hu.company.website/error-80.log debug;

        location / {
                try_files $uri /index.php/$args;
        }

        location ~ /index.php/ {
                fastcgi_pass 127.0.0.1:9000;
                fastcgi_index  index.php;
                fastcgi_param  SCRIPT_FILENAME  $document_root/index.php;
                fastcgi_param  REQUEST_URI      $request_uri;
                fastcgi_param  QUERY_STRING     $query_string;
                fastcgi_param  REQUEST_METHOD   $request_method;
                fastcgi_param  CONTENT_TYPE     $content_type;
                fastcgi_param  CONTENT_LENGTH   $content_length;
                include fastcgi_params;
        }

        location ~ \.php$ {
                fastcgi_pass 127.0.0.1:9000;
                fastcgi_index  index.php;
                fastcgi_param  SCRIPT_FILENAME  $document_root/$fastcgi_script_name;
                fastcgi_param  REQUEST_URI      $request_uri;
                fastcgi_param  QUERY_STRING     $query_string;
                fastcgi_param  REQUEST_METHOD   $request_method;
                fastcgi_param  CONTENT_TYPE     $content_type;
                fastcgi_param  CONTENT_LENGTH   $content_length;
                include fastcgi_params;
        }

location ~ /\.ht {
deny all;
}

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

server {
listen                  443 ssl;
server_name             website.company.hu;

ssl_certificate         /etc/nginx/ssl/company.hu.combined.crt;
ssl_certificate_key     /etc/nginx/ssl/company.hu.key;

root                    /var/www/hu.company.website;

error_log               /var/log/nginx/hu.company.website/error-443.log debug;
access_log              /var/log/nginx/hu.company.website/access-443.log;

index index.html index.htm index.pl;

rewrite ^/index\.php?(.*)$ /$1 permanent;

location / {
root /var/www/hu.company.website;
index index.html index.htm index.pl;
try_files $uri $uri/ /index.php;

}

location @rewrite {
       rewrite ^(.*)$ /index.php/$1 last;
}

location ~ ^/index.php(/|$) {
       fastcgi_pass 127.0.0.1:9000;
       fastcgi_split_path_info ^(.+\.php)(/.*)$;
       include fastcgi_params;
       fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}

location ~ /\.ht {
deny all;
}
location = /favicon.ico {
access_log off;
log_not_found off;
}
}



In terminal if I call the main index.php then I can see the code of the site I wish to see. However in browsers I get 403 Forbidden error messages. Log from NginX file is:


Code:
==> /var/log/nginx/hu.company.website/error-443.log <==
2017/02/08 17:06:39 [notice] 20108#0: *8 "^/index\.php?(.*)$" does not match "/", client: XX.XXX.XXX.XXX, server: website.company.hu, request: "GET / HTTP/1.1", host: "website.company.hu"
2017/02/08 17:06:39 [error] 20108#0: *8 directory index of "/var/www/hu.company.website/" is forbidden, client: XX.XXX.XXX.XXX, server: website.company.hu, request: "GET / HTTP/1.1", host: "website.company.hu"

==> /var/log/nginx/hu.company.website/access-443.log <==
XX.XXX.XXX.XXX - - [08/Feb/2017:17:06:39 +0100] "GET / HTTP/1.1" 403 570 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36"


I get the same error message even if I give 777 recursive to the folder. The files are owned by the right user to be accessable by anyone coming from browser (so the same for all websites)

Can you help me out by asking for file codes? I don't know Codeigniter and I don't know where to start looking.

Thank you in advance!

Bert
Reply
#2

OK, now I'm getting a blank screen. Already anabled error displaying, but nothing. And whatever I write after the main domain, I get a "200 OK" status even if the file what I'm referring to is not existent. Pretty mutch like: website.company.hu/asdfasdfasdf
And I still get 200 OK

If I execute in terminal php index.php, then I can see the websites source code, so it should be working. In the codeigniter log it starts logging this time and it logs this:


Code:
ERROR - 2017-02-09 14:38:11 --> Severity: Notice  --> Undefined index: HTTP_HOST /var/www/hu.company.website/application/config/config.php 20
ERROR - 2017-02-09 14:38:11 --> Severity: Notice  --> Only variable references should be returned by reference /var/www/hu.company.website/system/core/Common.php 243
DEBUG - 2017-02-09 14:38:11 --> Config Class Initialized
DEBUG - 2017-02-09 14:38:11 --> Hooks Class Initialized
DEBUG - 2017-02-09 14:38:11 --> Utf8 Class Initialized
DEBUG - 2017-02-09 14:38:11 --> UTF-8 Support Enabled
DEBUG - 2017-02-09 14:38:11 --> URI Class Initialized
DEBUG - 2017-02-09 14:38:11 --> Router Class Initialized
DEBUG - 2017-02-09 14:38:11 --> No URI present. Default controller set.
DEBUG - 2017-02-09 14:38:11 --> Output Class Initialized
DEBUG - 2017-02-09 14:38:11 --> Security Class Initialized
DEBUG - 2017-02-09 14:38:11 --> Input Class Initialized
DEBUG - 2017-02-09 14:38:11 --> Global POST and COOKIE data sanitized
DEBUG - 2017-02-09 14:38:11 --> Language Class Initialized
DEBUG - 2017-02-09 14:38:11 --> Loader Class Initialized
DEBUG - 2017-02-09 14:38:11 --> Controller Class Initialized
DEBUG - 2017-02-09 14:38:11 --> Helper loaded: utils_helper
DEBUG - 2017-02-09 14:38:11 --> Session Class Initialized
DEBUG - 2017-02-09 14:38:11 --> Helper loaded: string_helper
DEBUG - 2017-02-09 14:38:11 --> A session cookie was not found.
ERROR - 2017-02-09 14:38:11 --> Severity: Warning  --> Cannot modify header information - headers already sent by (output started at /var/www/hu.company.website/application/helpers/utils_helper.php:1) /var/www/hu.company.website/system/libraries/Session.php 671
DEBUG - 2017-02-09 14:38:11 --> Session routines successfully run
DEBUG - 2017-02-09 14:38:11 --> Jquery Class Initialized
DEBUG - 2017-02-09 14:38:11 --> Javascript Class Initialized and loaded.  Driver used: jquery
ERROR - 2017-02-09 14:38:11 --> Severity: Warning  --> session_start(): Cannot send session cookie - headers already sent by (output started at /var/www/hu.company.website/application/helpers/utils_helper.php:1) /var/www/hu.company.website/application/libraries/facebook/ci_facebook.php 37
ERROR - 2017-02-09 14:38:11 --> Severity: Warning  --> session_start(): Cannot send session cache limiter - headers already sent (output started at /var/www/hu.company.website/application/helpers/utils_helper.php:1) /var/www/hu.company.website/application/libraries/facebook/ci_facebook.php 37
DEBUG - 2017-02-09 14:38:11 --> User Agent Class Initialized
ERROR - 2017-02-09 14:38:11 --> Severity: Notice  --> Undefined index: HTTP_HOST /var/www/hu.company.website/application/config/database.php 60
DEBUG - 2017-02-09 14:38:11 --> Database Driver Class Initialized
ERROR - 2017-02-09 14:38:11 --> Severity: 8192  --> mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead /var/www/hu.company.website/system/database/drivers/mysql/mysql_driver.php 88
DEBUG - 2017-02-09 14:38:11 --> Helper loaded: html_helper
DEBUG - 2017-02-09 14:38:11 --> Helper loaded: url_helper
DEBUG - 2017-02-09 14:38:11 --> Helper loaded: form_helper
DEBUG - 2017-02-09 14:38:11 --> Helper loaded: window_helper
DEBUG - 2017-02-09 14:38:11 --> Model Class Initialized
DEBUG - 2017-02-09 14:38:11 --> Model Class Initialized
DEBUG - 2017-02-09 14:38:11 --> Model Class Initialized
DEBUG - 2017-02-09 14:38:11 --> Config file loaded: application/config/facebook.php
DEBUG - 2017-02-09 14:38:11 --> Model Class Initialized
DEBUG - 2017-02-09 14:38:11 --> Model Class Initialized
ERROR - 2017-02-09 14:38:11 --> Severity: Warning  --> Cannot modify header information - headers already sent by (output started at /var/www/hu.company.website/application/helpers/utils_helper.php:1) /var/www/hu.company.website/system/libraries/Session.php 671
ERROR - 2017-02-09 14:38:11 --> Severity: Warning  --> Cannot modify header information - headers already sent by (output started at /var/www/hu.company.website/application/helpers/utils_helper.php:1) /var/www/hu.company.website/system/libraries/Session.php 671
ERROR - 2017-02-09 14:38:11 --> Severity: Notice  --> Undefined index: HTTP_HOST /var/www/hu.company.website/application/controllers/website.php 90
ERROR - 2017-02-09 14:38:11 --> Severity: Warning  --> Cannot modify header information - headers already sent by (output started at /var/www/hu.company.website/application/helpers/utils_helper.php:1) /var/www/hu.company.website/system/libraries/Session.php 671
ERROR - 2017-02-09 14:38:11 --> Severity: Warning  --> Cannot modify header information - headers already sent by (output started at /var/www/hu.company.website/application/helpers/utils_helper.php:1) /var/www/hu.company.website/system/libraries/Session.php 671
ERROR - 2017-02-09 14:38:11 --> Severity: Notice  --> Undefined index: signed_request /var/www/hu.company.website/application/models/facebook_model.php 27
ERROR - 2017-02-09 14:38:11 --> Severity: Notice  --> Undefined offset: 1 /var/www/hu.company.website/application/models/facebook_model.php 177
ERROR - 2017-02-09 14:38:13 --> Severity: Warning  --> Cannot modify header information - headers already sent by (output started at /var/www/hu.company.website/application/helpers/utils_helper.php:1) /var/www/hu.company.website/system/libraries/Session.php 671
ERROR - 2017-02-09 14:38:13 --> Severity: Warning  --> Cannot modify header information - headers already sent by (output started at /var/www/hu.company.website/application/helpers/utils_helper.php:1) /var/www/hu.company.website/system/libraries/Session.php 671
DEBUG - 2017-02-09 14:38:13 --> File loaded: application/views/default_head_view.php
DEBUG - 2017-02-09 14:38:13 --> File loaded: application/views/aboutandlike_view.php
DEBUG - 2017-02-09 14:38:13 --> File loaded: application/views/default_foot_view.php
DEBUG - 2017-02-09 14:38:13 --> Final output sent to browser
DEBUG - 2017-02-09 14:38:13 --> Total execution time: 2.2939


Is this any help?
Reply




Theme © iAndrew 2016 - Forum software by © MyBB