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.

有帮助吗?

解决方案 2

Short tags were the problem.

<? to <?php fixed this.

其他提示

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top