Welcome Guest, Not a member yet? Register   Sign In
CI + OSX 10.6.7 + nginx + php-cgi rendering output problem
#1

[eluser]nuri[/eluser]
I'm using my MacBook Pro (OSX 10.6.7) as development server with this configuration

nginx 0.8.54_0
php5 @5.3.6_0+fastcgi
fcgi @2.4.0_3
spawn-fcgi @1.6.3_0
my CI is 1.7.2 and 1.7.3

my directory stucture is like this

Code:
my document root is /Users/nuri/Sites
my CI system located in /Users/nuri/frameworks/CI/system
my CI application located in /Users/nuri/project/apps1/application

the problem is nginx did not return/print anything when accessing any CI controllers
i test using apache from MAMP packages the controllers are working fine

sample accessing index.php/welcome

from CI logfile, the Nginx seems to be stop at this state
Code:
DEBUG - 2011-04-07 20:39:36 --> Config Class Initialized
DEBUG - 2011-04-07 20:39:36 --> Hooks Class Initialized
DEBUG - 2011-04-07 20:39:36 --> URI Class Initialized
DEBUG - 2011-04-07 20:39:36 --> Router Class Initialized
DEBUG - 2011-04-07 20:39:36 --> Output Class Initialized
DEBUG - 2011-04-07 20:39:36 --> Input Class Initialized
DEBUG - 2011-04-07 20:39:36 --> Global POST and COOKIE data sanitized
DEBUG - 2011-04-07 20:39:36 --> Language Class Initialized
DEBUG - 2011-04-07 20:39:36 --> Loader Class Initialized
DEBUG - 2011-04-07 20:39:36 --> Helper loaded: form_helper
DEBUG - 2011-04-07 20:39:36 --> Helper loaded: url_helper
DEBUG - 2011-04-07 20:39:36 --> Database Driver Class Initialized


when accessing with apache, the log said:
Code:
DEBUG - 2011-04-07 20:40:09 --> Config Class Initialized
DEBUG - 2011-04-07 20:40:09 --> Hooks Class Initialized
DEBUG - 2011-04-07 20:40:09 --> URI Class Initialized
DEBUG - 2011-04-07 20:40:09 --> Router Class Initialized
DEBUG - 2011-04-07 20:40:09 --> Output Class Initialized
DEBUG - 2011-04-07 20:40:09 --> Input Class Initialized
DEBUG - 2011-04-07 20:40:09 --> XSS Filtering completed
DEBUG - 2011-04-07 20:40:09 --> XSS Filtering completed
DEBUG - 2011-04-07 20:40:09 --> Global POST and COOKIE data sanitized
DEBUG - 2011-04-07 20:40:09 --> Language Class Initialized
DEBUG - 2011-04-07 20:40:09 --> Loader Class Initialized
DEBUG - 2011-04-07 20:40:09 --> Helper loaded: form_helper
DEBUG - 2011-04-07 20:40:09 --> Helper loaded: url_helper
DEBUG - 2011-04-07 20:40:09 --> Database Driver Class Initialized
DEBUG - 2011-04-07 20:40:09 --&gt; Session Class Initialized   <-------- missing this line below <<<
DEBUG - 2011-04-07 20:40:09 --&gt; Helper loaded: string_helper
DEBUG - 2011-04-07 20:40:09 --&gt; Session routines successfully run
DEBUG - 2011-04-07 20:40:09 --&gt; User Agent Class Initialized
DEBUG - 2011-04-07 20:40:09 --&gt; Controller Class Initialized
DEBUG - 2011-04-07 20:40:09 --&gt; Final output sent to browser
DEBUG - 2011-04-07 20:40:09 --&gt; Total execution time: 0.0582

i try to make traps
i found the CI + nginx "did not process" anything
from system/codeigniter/CodeIgniter.php starting with line
Code:
$CI = new $class();



please, desperately need help from the expert here


my nginx server config is
Code:
server {
        listen       8080;
        server_name  jupiter;
        
        index index.php index.html index.htm;
    root /Users/nuri/Sites;
        access_log  /tmp/jupiter.access.log  webalizer;
        error_log  /tmp/jupiter.error.log debug;

        client_max_body_size       5m;
        client_body_buffer_size    256k;

        #error_page 404 /index.php;

        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        error_page   404 /40x.html;
        location = /50x.html {
            root   /opt/local/html;
        }
        
        location = /40x.html {
            root   /opt/local/html;
        }

    location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ {
            access_log        off;
            expires           30d;
            #expires max;
        add_header Pragma public;
        add_header Cache-Control "public, must-revalidate, proxy-revalidate";
            break;
    }
                
        location ^/project/apps1/ {
            if (!-e $request_filename) {
                  rewrite ^/project/apps1/(.*)$ /project/apps1/index.php/$1 last;
              }
        }
        

        location /project/apps1/index.php {
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_param SCRIPT_FILENAME /Users/nuri/Sites/project/apps1/index.php;
            include        /opt/local/etc/nginx/fastcgi_params;            
        }

        location ~ \.php$ {
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            include        /opt/local/etc/nginx/fastcgi_params;            
        }

        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        location ~ /\.ht {
            deny  all;
        }
    }
#2

[eluser]nuri[/eluser]
it works fine in production server, which is using
FreeBSD 7.2
php-5.2.12
spawn-fcgi-1.6.3
nginx-0.7.65

is it something with the php fastcgi version in my mac + nginx-0.8.x?
#3

[eluser]nuri[/eluser]
i think i've solved it
problem seems to be the Macports php5 +fastcgi

i recompile the PHP 5.3.6 from source with option --enable-cgi
and the CI works fine just like in my freebsd box




Theme © iAndrew 2016 - Forum software by © MyBB