# Test.php being downloaded instead of displayed

**URL:** <https://www.ruby-forum.com/t/test-php-being-downloaded-instead-of-displayed/195894>\
**Category:** NGINX\
**Created:** [October 2, 2010, 4:15am UTC](https://www.ruby-forum.com/t/test-php-being-downloaded-instead-of-displayed/195894 "2010-10-02T04:15:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [October 2, 2010, 4:15am UTC](https://www.ruby-forum.com/t/test-php-being-downloaded-instead-of-displayed/195894/1 "2010-10-02T04:15:53Z")

</div>

I set up a simple test.php on my server with

\<?php phpinfo(); ?\>

but it seems like when i browse to the file its being downloaded instead  
of displayed in the browser window. does anyone know how i can fix  
this?

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [October 2, 2010, 4:25am UTC](https://www.ruby-forum.com/t/test-php-being-downloaded-instead-of-displayed/195894/2 "2010-10-02T04:25:50Z")

</div>

What is your nginx configuration?

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [October 2, 2010, 4:28am UTC](https://www.ruby-forum.com/t/test-php-being-downloaded-instead-of-displayed/195894/3 "2010-10-02T04:28:10Z")

</div>

what do u mean? sry im still new

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [October 2, 2010, 4:34am UTC](https://www.ruby-forum.com/t/test-php-being-downloaded-instead-of-displayed/195894/4 "2010-10-02T04:34:01Z")

</div>

No problem… we were all new one time, I’m still learning.

How are you planning on serving php?

Nginx by itself does not process scripts, simply passes the requests to  
a  
backend.

Google: php-fpm (see [php-fpm.org](http://php-fpm.org)) or apache mod\_php for example.

Your nginx configuration file is called “nginx.conf” in it you specify  
how  
you want php to be served.

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [October 2, 2010, 4:35am UTC](https://www.ruby-forum.com/t/test-php-being-downloaded-instead-of-displayed/195894/5 "2010-10-02T04:35:12Z")

</div>

On 2 Out 2010 03h14 WEST, [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I set up a simple test.php on my server with
> 
> \<?php phpinfo(); ?\>
> 
> but it seems like when i browse to the file its being downloaded  
> instead of displayed in the browser window. does anyone know how i  
> can fix this?

Configure nginx to pass all requests for PHP files to the FastCGI  
process. Check the wiki for configuration examples.

— appa
