Question

What am I doing wrong here? My config is as follows:

server {
listen        80;
server_name   internal.lan;

access_log /var/log/nginx/int-access.log;
error_log  /var/log/nginx/int-error.log;
root       /var/www/int;

location ~ \.php$ {
    include fastcgi_params;
    fastcgi_index index.php;
    fastcgi_pass unix:/var/run/php5-fpm.sock;
}
}

I've checked that the socket exists at the path in question, but any PHP files just get presented as plain text.

Probably a very simple one as I've never configured PHP with a server besides Apache before; can anyone help? Thanks.

Was it helpful?

Solution 2

Short tags were the problem.

<? to <?php fixed this.

OTHER TIPS

Ah we had problems like this a dozen of times. The solution was for us to put php and nginx under the same user group.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top