1

I'm getting this weird forbidden error when I post form data. I have this form which has multiple input fields. It works fine till it reaches 200 input fields. When it exceeds 200 fields I get 403 forbidden error. I've set the post max size to 100M and max input vars 100000 but still no luck.

Any ideas?

Mike
  • 23,542
  • 14
  • 76
  • 87
Heman G
  • 75
  • 1
  • 12
  • 200 input fields , isn't that a bit off the track? Think of a user who has to fill these fields. Shouldn't you split these fields into multiple forms (Something like a wizard) – Satya Jan 07 '14 at 02:09
  • 1
    Check your error log. – Mike Jan 07 '14 at 02:14
  • Start dumping and dying your super variables. It seems your not catching something in your code. Please post your work. – justinpage Jan 07 '14 at 02:17
  • @Satya: They're chart of accounts uploading from excel and other sources. – Heman G Jan 07 '14 at 02:22
  • @Mike: Can't find anything in the error log – Heman G Jan 07 '14 at 02:23
  • 1
    Are you using `method=GET`? You may be running into a limit on the size of a URL. Use `method=POST` and there's effectively no limit. – Barmar Jan 07 '14 at 02:24
  • @Heman maybe you're not looking in the right place. Or maybe logging is disabled. Try `phpinfo()` and look for the `error_log` value and make sure it's set and check that file. – Mike Jan 07 '14 at 02:24
  • @KLVTZ: same code works fine in the local server. Not sure if it's server configuration – Heman G Jan 07 '14 at 02:25
  • @Barmar good thinking, but wouldn't that just truncate the values sent through $_GET? – Mike Jan 07 '14 at 02:25
  • @Barmar: i'm using POST – Heman G Jan 07 '14 at 02:26
  • @Heman there's your answer. Your remote is not working because it does not contain the same settings as your local. If everything is working fine locally, then you will need to adjust your settings remotely. – justinpage Jan 07 '14 at 02:28
  • @KLVTZ: what specific settings should I change? – Heman G Jan 07 '14 at 02:36
  • @Heman, you said you adjusted your max_input_vars locally or remotely? If locally, then do the same remotely. – justinpage Jan 07 '14 at 02:38
  • @KLVTZ: I've changed it on the sever too – Heman G Jan 07 '14 at 02:46
  • @Mike: error_log is fine. but there's no error recorded for this issue – Heman G Jan 07 '14 at 02:47
  • @Heman sorry, I was wrong. Check your web server's error log. If it were a PHP error it would change it to a 500 response code, not 403. – Mike Jan 07 '14 at 02:49
  • There really isn't enough information here to help. 403 seems rather suspicious. What does your stack look like... is this hosted? – user602525 Jan 07 '14 at 02:57
  • a 403 forbidden error under this context seems that you may have some type of protection enabled for long query strings, or something of that sort. – Ohgodwhy Jan 07 '14 at 03:01
  • @Mike: It says File does not exist – Heman G Jan 07 '14 at 03:06
  • Are you sure you're looking at the right place? File does not exist is a 404 error. – Mike Jan 07 '14 at 03:07
  • @user602525: Yes it's hosted. What information you need? – Heman G Jan 07 '14 at 03:08
  • @Mike: yes I'm checking from cpanel. – Heman G Jan 07 '14 at 04:04
  • @Heman who is your host? My goodness, if I can say, this entire answer and question is becoming a discussion and not what is originally purpose for a comment section. – justinpage Jan 07 '14 at 04:52
  • @KLVTZ: it's a local company (hostingbay) – Heman G Jan 07 '14 at 05:07
  • @HemanYou expressed that you are using cPanel for the majority of your adjustments. You can navigate to your cPanel's software/services and should select PHP config. From there, you will have to adjust your PHP.ini file. That file is the key to fixing your problem on a remote hosting that is hostingbay. – justinpage Jan 07 '14 at 20:38
  • @KLVTZ Unfortunately, I don't have permission to edit the server PHP.ini. BTW I have added custom PHP.ini in the directory. So when I run phpinfo it appears all the custom settings. I'm sure it's something to do with the server configuration but not sure which one it is. – Heman G Jan 07 '14 at 22:56
  • @Heman, so it applies the .ini file? In other words, are you still experiencing your problem? – justinpage Jan 08 '14 at 00:16
  • @kLVTZ: yes. it hasn't solved the prob. It's so weird. – Heman G Jan 08 '14 at 00:30
  • @Heman I really want us to get to the bottom of this problem, have you tried the selected answer from this question? http://stackoverflow.com/questions/18447454/apache-giving-403-forbidden-errors – justinpage Jan 08 '14 at 00:58
  • @KLVTZ, Yes I've been looking for answers everywhere. nothing works out so far. Thanks for commenting. – Heman G Jan 08 '14 at 02:10
  • @Heman My pleasure in helping. If you do end up solving this very odd problem, be sure to post it as an answer for reference -you can answer your own questions. – justinpage Jan 08 '14 at 02:15
  • @KLVTZ, sure I will. BTW I have no clue on this. Dunno why it's not even creating a record on error log. – Heman G Jan 08 '14 at 02:18
  • Hello Guys, problem has been solved. I contacted the host and they've disable mod_security on our account and it works. BTW, i'm not sure if it's safe to disable mod_sec. Anyway, thanks everyone for commenting on this. Good day! – Heman G Jan 08 '14 at 22:36

1 Answers1

1

problem has been solved. I contacted the host and they've disabled mod_security on our account and it works. BTW, i'm not sure if it's safe to disable mod_sec. Anyway, thanks everyone for commenting on this. Good day!

Heman G
  • 75
  • 1
  • 12