Welcome! Log In Create A New Profile

Advanced

FCGI setup - Not executing PHP files

Posted by miradev 
FCGI setup - Not executing PHP files
July 03, 2009 06:03AM
I have this single set up for an admin domain, however I am downloading the php files, rather than executing them.
I'm guessing that there is an issue with my fcgi. Bu then I could be wrong..

[code]
server {
listen localhost:80; # your server's public IP address
server_name .admin.domain.com;

access_log /var/log/nginx/wordpress/admin/generic-access.log;
error_log /var/log/nginx/wordpress/admin/generic-error.log;

set $client $host;
if ($client ~ "^([a-z0-9]*).admin.domain.com"){
set $client $1;
}

location ~ ^/([^/]*)/?(.*) {
set $domain $1;
set $myuri $2;
root /var/www/wordpress/$client/admin/$domain/html;
}

location / {
index index.php index.html index.htm;
if (-f $request_filename) {
expires 30d;
break;
}

try_files /system/maintenance.html $domain/$myuri $domain/$myuri/ /$domain/index.php?q=$myuri&$args;
}


location /$domain {
alias /;
}

location ~ \.php$ {
fastcgi_pass localhost:13693;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/wordpress/$client/admin/$domain/html$fastcgi_script_name;
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_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param SERVER_PROTOCOL $server_protocol;

fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;

fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;

# required if PHP was built with --enable-force-cgi-redirect
fastcgi_param REDIRECT_STATUS 200;
}
}
[/code]
Re: FCGI setup - Not executing PHP files
July 03, 2009 11:29AM
well i had this problem also, but that didnt had anything to do with nginx.
i forgot to install php_cli but i am running on ubuntu vps, for debugging purpose if you have linuxbox with atleast ssh acces
try to excute php file locally just to see if your prob isnt locally.

it sound kinda like a locally prob, but if you can excute php files locally at least you know your php is correct.
grts,

chris
Re: FCGI setup - Not executing PHP files
July 06, 2009 04:38AM
eaonflux Wrote:
-------------------------------------------------------
> well i had this problem also, but that didnt had
> anything to do with nginx.
> i forgot to install php_cli but i am running on
> ubuntu vps, for debugging purpose if you have
> linuxbox with atleast ssh acces
> try to excute php file locally just to see if your
> prob isnt locally.
>
> it sound kinda like a locally prob, but if you can
> excute php files locally at least you know your
> php is correct.
> grts,

I am successfully serving WP sites using nginx and fcgi in other configs. So I doubt the issue is there.
I am only getting this behaviour for this specific config.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 297
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready