Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 916
  • Last Modified:

Wordpress > Uploading image > Invalid method in request

Using IE7 gives the code 7da15513b0758 and using FF3.6 give the code 20495798211440.

Searching Google points this to a SSL issue but this is a new install of Wordpress, no SSL in use here!  We're on CentOS5.4 with Apache 2.2.  This is a dedicated server.

[Mon Aug 23 01:19:29 2010] [error] [client 127.0.0.0] Invalid method in request -----------------------------7da15513b0758
[Mon Aug 23 01:20:22 2010] [error] [client 127.0.0.0] Invalid method in request -----------------------------20495798211440

Open in new window

0
Geoff Millikan
Asked:
Geoff Millikan
  • 4
  • 2
1 Solution
 
ZenArcherCommented:
Sometimes the error messages are misleading.

I believe that either a WordPress core file is corrupted, or -- more likely --  a directory permission is incorrect. Check the location of the upload directory is valid,
see,
http://codex.wordpress.org/Settings_Media_SubPanel

(for WordPress <3.x, see the "Miscellaneous" Subpanel)
http://codex.wordpress.org/Settings_Miscellaneous_SubPanel

Also check permissions on the wp-content/uploads directory, try setting it to "755" or "777" and then attempt to upload again.

see also,
http://codex.wordpress.org/Changing_File_Permissions

Good luck!
0
 
Geoff MillikanAuthor Commented:
Here's the directories and permissions:

0755 /home/domain/www/
0777 /home/domain/www/wp-content/
0777 /home/domain/www/wp-content/uploads/

I've attached 3 things below: (1) the Apache error log and (2) the headers that the browser sent to web server and (3) the the screen shot from Wordpress.

Could it be that php.ini isn't allowing file uploads or something like that?


---== Apache Error log ==--
[Mon Aug 23 15:51:44 2010] [error] [client 71.0.0.0] Invalid method in request -----------------------------7da32a29b0758

---== Headers sent by Frirefox browser ==---
http://www.doamin.com/wp-admin/media-upload.php?inline=&upload-page-form=

POST /wp-admin/media-upload.php?inline=&upload-page-form= HTTP/1.1
Host: www.doamin.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8 (.NET CLR 3.5.30729)
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Referer: http://www.doamin.com/wp-admin/media-new.php
Cookie: wordpress_98b21f6068eab2dddd34dae82e505582=username%7C1281114101%7C80f5ebb00860c81a09eb77129188ebb0; wordpress_test_cookie=WP+Cookie+check; wordpress_logged_in_98b21f6068eab2dddd34dae82e505582=username%7C1283734101%7Cf1d405e11113a8bb5e1984e3ded471c3; wp-settings-time-1=1282525398; wp-settings-1=uploader%3D1
Content-Type: multipart/form-data; boundary=---------------------------11742186154173
Content-Length: 126389
-----------------------------11742186154173
Content-Disposition: form-data; name="async-upload"; filename="1.jpg"
Content-Type: image/jpeg

ÿØÿà

Open in new window

ScreenShot012.png
0
 
Geoff MillikanAuthor Commented:
Well, changed my php.ini settings to allow file uploads but there's no improvement - same issue and error log.

http://mu.wordpress.org/forums/topic/14893
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
ZenArcherCommented:
OK. I would try using the plain "Browser uploader" instead of the Flash uploader.
Have you tried that one? Also, try using a different image, it may just be that your image is corrupted. (Try one that has been previously uploaded successfully.)

Also, you might want to give this a try:
http://wordpress.org/extend/plugins/image-upload-http-error-fix/
or just place the attached mod_security CODE into your root htaccess file

see this page for a full discussion of similar issues:
http://wordpress.org/support/topic/http-error-on-image-upload-still


<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>

Open in new window

0
 
Geoff MillikanAuthor Commented:
> I would try using the plain "Browser uploader" instead of the Flash uploader.

Yep, tried that too.  Tried several different browser.  No love.

> Also, try using a different image, it may just be that your image is corrupted.

Tried a PDF, no love.

> Try one that has been previously uploaded successfully.

I haven't been able to upload anything successfully using Wordpress.

Per list below, we're not using mod_security, so no need to disable it.
# httpd -t -D DUMP_MODULES
[Mon Aug 23 17:49:39 2010] [warn] module php5_module is already loaded, skipping
Loaded Modules:
 core_module (static)
 mpm_prefork_module (static)
 http_module (static)
 so_module (static)
 auth_basic_module (shared)
 authn_file_module (shared)
 authz_host_module (shared)
 authz_user_module (shared)
 include_module (shared)
 log_config_module (shared)
 env_module (shared)
 mime_module (shared)
 deflate_module (shared)
 headers_module (shared)
 setenvif_module (shared)
 autoindex_module (shared)
 negotiation_module (shared)
 dir_module (shared)
 alias_module (shared)
 rewrite_module (shared)
 proxy_module (shared)
 proxy_http_module (shared)
 proxy_connect_module (shared)
 cache_module (shared)
 cgi_module (shared)
 php5_module (shared)
 ssl_module (shared)
Syntax OK

Open in new window

0
 
Geoff MillikanAuthor Commented:
I found the issue!  For security reasons like avoiding slowloris attacks, we had set LimitRequestBody to a value of 10240 which prevents HTTP requests over 10240 bytes.  So we just altered this setting for the one location while keeping the server-wide setting like this:

[Below are sample contents of the httpd.conf file:]
#blah blah service-wide config settings
LimitRequestBody 10240
#blah blah more service-wide config settings
<VirtualHost *:80>
    ServerName      www.mydomain.com
          ServerAlias      mydomain.com
          ServerAdmin      abuse@mydomain.com
          <Directory "/home/mydomain/www/wp-admin">
                LimitRequestBody 6291456
                    AllowOverride None
          CustomLog       logs/access_log combined
          ErrorLog        logs/error_log
    </Directory>
</VirtualHost>

See this for more details:
http://httpd.apache.org/docs/current/mod/core.html#limitrequestbody
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now