I didn't use a hidden form field for MAX_FILE_SIZE limiting 2mb file size. I have no php.ini file im my hosting server I have found a blank .htaccess in my public_html dir. So I have putted folling lines inside that file. But after that my site doesn't open & show error. php_value upload_max_filesize 20M php_value post_max_size 20M php_value max_execution_time 200 php_value max_input_time 200 PLEASE HELP HOW CAN I upload more than 2mb. Is my .htaccess file ok?
I believe it is php_flag php_flag upload_max_filesize 20M php_flag post_max_size 20M php_flag max_execution_time 200 php_flag max_input_time 200 Try that otherwise you can try using ini_set() If not then your host may be blocking it, otherwise contact your host to ask them how to solve it
rldowling03, I used your code. but the problem is same. my page shows following error message. Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log. Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.
Well then your host is most likely not allowing it or some other error. Contact your host and ask them about it, otherwise try ini_set() in the php file itself and delete those from the .htaccess ini_set("upload_max_filesize", "20M"); ini_set("post_max_size", "20M"); ini_set("max_execution_time", "200"); ini_set("max_input_time", "200"); PHP:
Dear rldowling03 , Thanks for your help. Would u please completely tell how can i use ini_set() and where to set, which file. I small full example code
Just put what I wrote in the top of your php file under <?php so <?php ini_set("upload_max_filesize", "20M"); ini_set("post_max_size", "20M"); ini_set("max_execution_time", "200"); ini_set("max_input_time", "200"); PHP:
It won't work via ini_set(). By that time, the upload will already be cancelled. Your server first uploads the file, then transfers control to PHP. If it doesn't work via .htaccess (with php_value command) then the only possible way to fix this is via php.ini. Contact your host and switch if they don't let you change it.