# NGINX and WordPress help.An Unexpected HTTP Error

**URL:** <https://www.ruby-forum.com/t/nginx-and-wordpress-help-an-unexpected-http-error/199033>\
**Category:** NGINX\
**Created:** [November 12, 2010, 6:29pm UTC](https://www.ruby-forum.com/t/nginx-and-wordpress-help-an-unexpected-http-error/199033 "2010-11-12T18:29:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/77aa72/32.png) [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Post date:** [November 12, 2010, 6:29pm UTC](https://www.ruby-forum.com/t/nginx-and-wordpress-help-an-unexpected-http-error/199033/1 "2010-11-12T18:29:03Z")

</div>

Getting a strange error when I try to browse to the install pages on my  
site’s wp-admin, running 32-bit Arch, NGINX 0.8.53, PHP 5.3.3  
(fpm-fcgi), and so far I’ve tried this on WP 3.0.0 and 3.0.1.

```auto
An Unexpected HTTP Error occurred during the API request.
```

The common solution (which did not work for me…or a litany of other  
users according to what I’ve found on google) is to change the timeout  
in wp-includes/class-http.php to something greater than or equal to 30  
seconds:

```auto
'timeout' => apply_filters( 'http_request_timeout', 5)
```

After changing this setting I cleared my browser’s cache and still  
received error.

Here is my nginx.conf:

[code]user nginx nginx;  
worker\_processes 1;  
pid /var/run/nginx.pid;

events {  
worker\_connections 1024;  
}

http {  
set\_real\_ip\_from 204.93.240.0/24;  
set\_real\_ip\_from 204.93.177.0/24;  
set\_real\_ip\_from 199.27.128.0/21;  
real\_ip\_header CF-Connecting-IP;

```
include mime.types;
default_type application/octet-stream;

log_format main '$remote_addr - $remote_user [$time_local] '
            '"$request" $status $bytes_sent '
            '"$http_referer" "$http_user_agent" '
            '"$gzip_ratio"';

client_header_timeout 3m;
client_body_timeout 3m;
send_timeout 3m;

client_header_buffer_size 1k;
large_client_header_buffers 4 4k;

gzip on;
gzip_min_length 1100;
gzip_buffers 4 8k;
gzip_types text/plain;

output_buffers 1 32k;
postpone_output 1460;

sendfile on;
tcp_nopush on;

tcp_nodelay on;

keepalive_timeout 75 20;

include /etc/nginx/sites-enabled/*;

```

}[/code]

Here is this vhost’s config file:

[code]server {  
server\_name direct.powermy.biz www.powermy.biz  
powermy.biz;  
access\_log /var/log/nginx/powermybiz.access.log main;  
error\_log /var/log/nginx/powermybiz.error.log;

```
location / {
    root /srv/www/powermy.biz/public_html;
    index index.html index.htm index.php;
    try_files $uri $uri/ /index.php?q=$uri&$args;
}

location ~ \.php$ {
    root /srv/www/powermy.biz/public_html;
    fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME

```

/srv/www/powermy.biz/public\_html/$fastcgi\_script\_name;  
fastcgi\_param PHP\_ADMIN\_VALUE  
“open\_basedir=/srv/www/powermy.biz/public\_html/:/srv/www/powermy.biz/logs/:/tmp/\nupload\_tmp\_dir=/tmp/”;  
fastcgi\_param PHP\_VALUE “allow\_url\_fopen=off”;  
include fastcgi\_params;  
}  
}[/code]

Before you ask, yes I have tried enabling fopen in both the vhost config  
and my php.ini and I have restarted php-fpm and nginx after making those  
changes, still to no avail.

Any help is appreciated!

Posted at Nginx Forum:

> **[NGINX and WordPress help...An Unexpected HTTP Error](https://forum.nginx.org/read.php?2,150188,150188#msg-150188)**
>
> Getting a strange error when I try to browse to the install pages on my site's wp-admin, running 32-bit Arch, NGINX 0.8.53, PHP 5.3.3 (fpm-fcgi), and so far I've tried this on WP 3.0.0 and 3.0.1. \[code\]An Unexpected HTTP Error occurred during the API...

---

<div class="post-metadata">

**Author:** ![sjnims](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/bc79bd/32.png) [@sjnims](https://www.ruby-forum.com/u/sjnims)\
**Post date:** [November 14, 2010, 2:16pm UTC](https://www.ruby-forum.com/t/nginx-and-wordpress-help-an-unexpected-http-error/199033/2 "2010-11-14T14:16:09Z")

</div>

Have you tried removing all the extra settings you have there and then  
adding them back one by one to see if one off them was interfering?

Posted at Nginx Forum:

> **[Re: NGINX and WordPress help...An Unexpected HTTP Error](https://forum.nginx.org/read.php?2,150188,150687#msg-150687)**
>
> Getting a strange error when I try to browse to the install pages on my site's wp-admin, running 32-bit Arch, NGINX 0.8.53, PHP 5.3.3 (fpm-fcgi), and so far I've tried this on WP 3.0.0 and 3.0.1. \[code\]An Unexpected HTTP Error occurred during the API...

---

<div class="post-metadata">

**Author:** ![sjnims](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/bc79bd/32.png) [@sjnims](https://www.ruby-forum.com/u/sjnims)\
**Post date:** [November 14, 2010, 5:07pm UTC](https://www.ruby-forum.com/t/nginx-and-wordpress-help-an-unexpected-http-error/199033/3 "2010-11-14T17:07:20Z")

</div>

Just tried, looks like it was a one-two punch combo of not clearing the  
cache every time a change was made and fastcgi\_param PHP\_VALUE  
“allow\_url\_fopen=off”; Removing that line and clearing the cache solved  
the problem.

Posted at Nginx Forum:

> **[Re: NGINX and WordPress help...An Unexpected HTTP Error](https://forum.nginx.org/read.php?2,150188,150712#msg-150712)**
>
> Getting a strange error when I try to browse to the install pages on my site's wp-admin, running 32-bit Arch, NGINX 0.8.53, PHP 5.3.3 (fpm-fcgi), and so far I've tried this on WP 3.0.0 and 3.0.1. \[code\]An Unexpected HTTP Error occurred during the API...
