You are not logged in.

#1 2010-12-20 21:12:43

foxbunny
Member
From: Serbia
Registered: 2006-10-31
Posts: 759
Website

[SOLVED] nginx, PHP-FPM, and url dispatching returing binary data

I'm trying to get nginx working with PHP-FPM and url dispatching. The current configuration is:

http://codepad.org/nNLvZXZX

What I'm trying to do is direct everything under ``/...`` except ``/static`` (but I haven't gotten to that yet) to a dispatch.php that sits in the root. I _think_ the dispatcher is being called, but I get a blank screen. The code in the dispatch.php is:

<?php

echo "Dispatcher";
error_log('Test');

?>

Nothing is output, and nothing in the error log. nginx error log seems to be empty. What can I do? What am I doing wrong?

EDIT: In fact, it's outputting BINARY data with dispatch.php's contents. I forgot to reload the conf. Now that I have, it's doing this with the above configuration.

Last edited by foxbunny (2010-12-20 23:41:40)

Offline

#2 2010-12-20 21:35:34

foutrelis
Developer
From: Athens, Greece
Registered: 2008-07-28
Posts: 705
Website

Re: [SOLVED] nginx, PHP-FPM, and url dispatching returing binary data

Does this help?

Offline

#3 2010-12-20 22:13:01

foxbunny
Member
From: Serbia
Registered: 2006-10-31
Posts: 759
Website

Re: [SOLVED] nginx, PHP-FPM, and url dispatching returing binary data

I've edited the original post as well, but no that didn't do it. In fact, I now get binary data as output, rather than plain text. Weird. I've asked a friend to copy me the default Ubuntu config, so I'll see. nginx+PHP-FPM works out of the box on Ubuntu w/o too much tweaking.

Offline

#4 2010-12-20 22:49:29

foxbunny
Member
From: Serbia
Registered: 2006-10-31
Posts: 759
Website

Re: [SOLVED] nginx, PHP-FPM, and url dispatching returing binary data

Ok, this is definitely not a nginx configuraiton issue. It's most likely php-fpm configuration. I'll try something and report back.

Offline

#5 2010-12-20 23:41:24

foxbunny
Member
From: Serbia
Registered: 2006-10-31
Posts: 759
Website

Re: [SOLVED] nginx, PHP-FPM, and url dispatching returing binary data

Solved. I had to add

default_type text/html;

to the server section. big_smile

Offline

Board footer

Powered by FluxBB