Tonic-_- Posted May 22, 2012 Share Posted May 22, 2012 Hello, It's been awhile since i've used Nginx and a website that I am running on the server uses include_once to include the header, sidebar and footer. The problem is they don't actually load under Nginx and was wondering if anyone else encountered this and knows how to solve this? Nothing logs into the php error log related to it. Here is the conf file. server { listen 80; server_name _; #charset koi8-r; access_log /home/web/logs/host.access.log main; location / { root /home/web/public_html; index index.php index.html index.htm; } error_page 404 /404.html; location = /404.html { root /usr/share/nginx/html; } location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ { access_log off; expires 30d; root /home/web/public_html; } # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } # proxy the PHP scripts to Apache listening on 127.0.0.1:80 # #location ~ \.php$ { # proxy_pass http://127.0.0.1; #} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # location ~ .php$ { fastcgi_split_path_info ^(.+\.php)(.*)$; fastcgi_pass 127.0.0.1:9000; fastcgi_param PHP_VALUE "error_log=/home/web/logs/php.error.log"; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /home/web/public_html$fastcgi_script_name; include fastcgi_params; fastcgi_param QUERY_STRING $query_string; fastcgi_param REQUEST_METHOD $request_method; fastcgi_param CONTENT_TYPE $content_type; fastcgi_param CONTENT_LENGTH $content_length; fastcgi_intercept_errors on; fastcgi_ignore_client_abort off; fastcgi_connect_timeout 60; fastcgi_send_timeout 50; fastcgi_read_timeout 50; fastcgi_buffer_size 128k; fastcgi_buffers 4 256k; fastcgi_busy_buffers_size 256k; fastcgi_temp_file_write_size 256k; } # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # location ~ /\.ht { deny all; } } Quote Link to comment https://forums.phpfreaks.com/topic/262936-php-fpm-and-nginx-include_once-problem/ Share on other sites More sharing options...
-sandro- Posted May 22, 2012 Share Posted May 22, 2012 looks very odd to me, maybe you're not using an absolute path in the include function? But that doesn't explain why php doesn't show any error if it can't find the file just an attempt try to change nginx settings like this fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; I remember that when the config settings are wrong and you try to open a non-existent php file it will return a black page Quote Link to comment https://forums.phpfreaks.com/topic/262936-php-fpm-and-nginx-include_once-problem/#findComment-1347754 Share on other sites More sharing options...
trq Posted May 23, 2012 Share Posted May 23, 2012 try using require_once instead of include_once. This should at least produce an error for you. Quote Link to comment https://forums.phpfreaks.com/topic/262936-php-fpm-and-nginx-include_once-problem/#findComment-1347851 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.