# Error parsing wp-app.php (Wordpress) on Nginx

**URL:** <https://www.ruby-forum.com/t/error-parsing-wp-app-php-wordpress-on-nginx/202483>\
**Category:** NGINX\
**Created:** [January 30, 2011, 5:04pm UTC](https://www.ruby-forum.com/t/error-parsing-wp-app-php-wordpress-on-nginx/202483 "2011-01-30T17:04:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [January 30, 2011, 5:04pm UTC](https://www.ruby-forum.com/t/error-parsing-wp-app-php-wordpress-on-nginx/202483/1 "2011-01-30T17:04:10Z")

</div>

I moved my website from apache to nginx and everything seems to be  
working as expected except (Well, I’ve only seen that error) when I try  
to create posts through the Atom publishing protocol which can be  
accesed via [http://wordpressblog.com/wp-app.php](http://wordpressblog.com/wp-app.php), on apache it worked  
well but on nginx it gives me a 404 error, I think it’s not only me  
because every other wordpress blog that is using nginx gives me that  
error.  
I could only find this that could be semi-related to this error:  
[#7361 (Fixes for wp-app with PHP-CGI) – WordPress Trac](http://core.trac.wordpress.org/ticket/7361) but it is a fix for apache  
and I can’t make it work on nginx  
Any ideas to fix it?  
If you have a wordpress blog running on nginx I’d appreciate if you tell  
me if you can correctly access your wp-app.php file.  
Note that I’m currently using php-cgi with nginx, Could php-fpm make it  
work?

I’ve also setup a dumb installation for testing purposes at  
[http://test.is-gorgeo.us/wp-app.php](http://test.is-gorgeo.us/wp-app.php) here is it’s php information:  
[http://test.is-gorgeo.us/phpinfo.php](http://test.is-gorgeo.us/phpinfo.php) with this nginx.conf file:  
[http://pastebin.com/qeUvpGrk](http://pastebin.com/qeUvpGrk) I don’t know if it’s useful but here is the  
content of the wp-app.php file: [http://pastebin.com/dX0Kn18i](http://pastebin.com/dX0Kn18i)

Posted at Nginx Forum:

> **[Error parsing wp-app.php (Wordpress) on Nginx](https://forum.nginx.org/read.php?2,170837,170837#msg-170837)**
>
> I moved my website from apache to nginx and everything seems to be working as expected except (Well, I've only seen that error) when I try to create posts through the Atom publishing protocol which can be accesed via...

---

<div class="post-metadata">

**Author:** ![Zarafolas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/90db22/32.png) [@Zarafolas](https://www.ruby-forum.com/u/Zarafolas)\
**Post date:** [January 30, 2011, 9:20pm UTC](https://www.ruby-forum.com/t/error-parsing-wp-app-php-wordpress-on-nginx/202483/2 "2011-01-30T21:20:35Z")

</div>

That was it, thank you.

Posted at Nginx Forum:

> **[Re: Error parsing wp-app.php (Wordpress) on Nginx](https://forum.nginx.org/read.php?2,170837,170888#msg-170888)**
>
> I moved my website from apache to nginx and everything seems to be working as expected except (Well, I've only seen that error) when I try to create posts through the Atom publishing protocol which can be accesed via...

---

<div class="post-metadata">

**Author:** ![Zarafolas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/90db22/32.png) [@Zarafolas](https://www.ruby-forum.com/u/Zarafolas)\
**Post date:** [January 30, 2011, 7:00pm UTC](https://www.ruby-forum.com/t/error-parsing-wp-app-php-wordpress-on-nginx/202483/3 "2011-01-30T19:00:25Z")

</div>

On 30 Jan 2011 16h02 WET, [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> you tell me if you can correctly access your wp-app.php file. Note  
> that I’m currently using php-cgi with nginx, Could php-fpm make it  
> work?
> 
> I’ve also setup a dumb installation for testing purposes at  
> [http://test.is-gorgeo.us/wp-app.php](http://test.is-gorgeo.us/wp-app.php) here is it’s php information:  
> [http://test.is-gorgeo.us/phpinfo.php](http://test.is-gorgeo.us/phpinfo.php) with this nginx.conf file:  
> [http://pastebin.com/qeUvpGrk](http://pastebin.com/qeUvpGrk) I don’t know if it’s useful but here is  
> the content of the wp-app.php file: [http://pastebin.com/dX0Kn18i](http://pastebin.com/dX0Kn18i)

This doesn’t make sense:  
if (!-e $request\_filename) {  
rewrite ^(.\*)$ /index.php last;  
}

You’re capturing the URI for what?

The Atom publishing works for me. I use a nested location and avoid  
fastcgi\_split\_path\_info. Following the suggestions of Igor and Maxim  
on the list some time ago. Here’s the PHP handling part.

```
    ## Regular PHP processing.
    location ~ ^(?<script>.+\.php)(?<path_info>.*)$ {
        include fastcgi.conf;
        ## The fastcgi_params must be redefined from the ones
        ## given in fastcgi.conf. No longer standard names
        ## but arbitrary: named patterns in regex.
        fastcgi_param SCRIPT_FILENAME $document_root$script;
        fastcgi_param SCRIPT_NAME $script;
        fastcgi_param PATH_INFO $path_info;
        ## Passing the request upstream to the FastCGI
        ## listener.
        fastcgi_pass unix:/tmp/php-cgi/php-cgi.socket;
        ## Upload progress support.
        track_uploads uploads 60s;
    }

```

Note that this is just a snippet from the full config. There is also a  
try\_files directive:

```
## The 'final' attempt to serve the request.
location @nocache {
    try_files $uri $uri/ /index.php?q=$uri&$args;
}

```

This config takes wp-super-cache in consideration. If you just want to  
use WP then the config on the Wiki [GitHub - nginxinc/nginx-wiki: ARCHIVED -- Source for the now archived NGINX Wiki section of https://www.nginx.com · GitHub](http://wiki.nginx.org/Wordpress),  
works (although using fastcgi\_split\_path\_info). In case you’re  
interested, my WP config is on github:  
[GitHub - perusio/wordpress-nginx: Nginx configuration for running WordPress · GitHub](https://github.com/perusio/wordpress-nginx)

I’ve yet to include the multi-site setup.  
— appa
