My company use FuelPHP and MySQL. it works fine. and now it need to develop another app using the same database.
so I try to built it using same FuelPHP.
I Try to install FuelPHP in virtual host. My fisrt app works fine. The second app can show login page correctly. But when I try to login, it shows an error message "
Fuel\Core\PhpErrorException [ Fatal Error ]: Input truncated by PHP. Number of variables exceeded . To increase the limit to at least the 2 needed for this HTTP request, change the value of "max_input_vars" in php.ini.
I never found this error message when developing 2nd app. so How can I fix this?
It says that your php.ini has a max_input_vars defined (the maximum number of variables in a POST), and your post request contains 2 variables more than the defined maximum limit.
This is a check that has been added to 1.9/develop recently. It turned out that although the docs state that a limit is applied and an E_WARNING is issued if the limit is exceeded, certain PHP versions don't throw this warning, but silently truncate your input, which could cause errors in your application because not all form variables are passed on to your application in a POST.
Doesn't really matter, the only difference is that after your change, both apps share the same /public, and they share the same fuel codebase.
We something like this:
/fuel
/core
/modules
/packages
/app1
/app
/modules
/packages
/public
/app2
/app
/modules
/packages
/public
so every app has it's own public folder and public assets, and modules and packages can be both global/shared or defined per application.
However, this doesn't have anything to do with the error message, which is related to the number of input fields in a form. And the default for max_input_vars is 1000, so you must have very large forms to get this error.
The default php.ini contains:
; How many GET/POST/COOKIE input variables may be accepted
If you have only two form fields, and the error message says you need at least two more, it suggests that ini_get('max_input_vars') returns zero (or something that evaluates to zero).
Can you var_dump(ini_get('max_input_vars')) in your index.php for me, and let me know what the exact result is? And also, what PHP version you exactly use?