View Full Version : [an error occurred while processing this directive] - only happens on large form

07-18-2012, 08:14 PM
I have a form that contains an album of photos. The photos are pulled from the database depending on which album is selected. Each photo has a checkbox. The user selects the desired photo and then presses submit. When the user presses submit, the checked boxes are sent to another page for processing. So far this works fine for most albums, with the largest working album around 100 photos, but there is one album that has 262 photos. If a user tries to submit the form from the large album, I get this error:

[an error occurred while processing this directive]

Any clue what that might be, and why it only happens with the larger album? I tried searching around and I've already tried switching the ipconfig file to FastCGI, but that didn't work. I'm not sure what else to try, as I have no clue what is causing the error.

07-18-2012, 09:30 PM
I assume you're not actually sending back 262 photos for a request? If so, cut it down to 1. All you need to know is the album to do anything with it, as you can seek the data you require with just that information.

That doesn't appear to be a PHP error. That looks like a status 500 possibly from an IIS server? These typically occur before the PHP processing starts, but if its IIS I can't be sure as I've never used it with PHP before.

07-18-2012, 09:53 PM
Each photo has a checkbox. Once that checkbox is checked, a div, containing numerous select menus, toggles to show. The numerous select menus are for choosing a quantity of various sized prints of that pic (e.g. 4"x6", 5"x7", etc.).

With the way I'm processing the form now, the do/while loop is running through the photos where the album equals the album_id. It is checking each pic to see if all of the select boxes are left blank. If at least one of the select menus has been changed, it processes that info.

Am I going about that the wrong way. Sorry if that is still vague. I've never made a form quite this extensive before.

07-18-2012, 11:14 PM
I also tried directing the form to a blank page just to see if maybe it's the form, itself, causing the problem, and not the processing. When sending to a blank page, I still get the error so I can only assume it's the size of the form that is causing the problem. Could there be some type of timeout or file limit that is causing it?

07-18-2012, 11:29 PM
I figured out the issue when I checked the error log in cpanel. It said this:

[18-Jul-2012 11:10:27] PHP Fatal error: Unknown: Input variables exceeded 1000. To increase the limit change max_input_vars in php.ini. in Unknown on line 0

My form was submitting over 1000 variables. So I had to go into the max_input_vars and set it to a higher number. It works now.

I know it probably isn't a good idea to have that many variables in a form. I probably should have used an array. That was the first time I've coding a form that involved that much content, though, so I know how to adjust it.