How to change import limit on phpmyadmin running with wampserver? [duplicate] - php

This question already has answers here:
Can't import database through phpmyadmin file size too large
(13 answers)
Can not increase file upload size WAMP
(4 answers)
Closed 4 years ago.
I can only upload files up to 128 MB big on Phpmyadmin. I need to change the value, so I tried to change the php.ini file via tray.
I already changed memory_limit = 128M to memory_limit = 2048M and restarted all services, but the limit in Phpmyadmin is still 128 MB.
Do I have to change another setting?
Update:
I figured out that you can also set it directly via the tray menu, but it makes no difference (restarted already):
Interestingly there is still 128M selected even after I changed it to 2048M in the php.ini. I set it to 2048M again via the tray menu.
memory_limit = 2048M
post_max_size = 2048M
upload_max_filesize = 2048M
max_execution_time = 300
max_input_time = 300
Made no difference.
The duplicate 'Can not increase file upload size WAMP' solved the problem.

Related

phpMyAdmin File Limit (already edited php.ini)

I'm trying to import a 151 MB database into phpMyAdmin and am getting the error "You probably tried to upload a file that is too large. Please refer to documentation for a workaround for this limit."
I've already edited php.ini with values of upload_max_filesize, memory_limit and post_max_size that more than accommodate this file. Is there anything else I can do to troubleshoot?
Try setting max_execution_time and max_input_time with higher values.
max_execution_time = 90
max_input_time = 120
You might want to try memory_limit as well and don't forget to restart the server.

issue with uploading heavy files above 5MB [duplicate]

This question already has answers here:
How to upload large files above 500MB in PHP [duplicate]
(3 answers)
Closed 6 years ago.
if(trim($_FILES["fileUpload"]["name"][$j]) != "")
{
move_uploaded_file($_FILES["fileUpload"]["tmp_name"][$j],"../../../../uploads/msg_attachment/".time()."_".$_FILES["fileUpload"]["name"][$j]);
}
upload_max_filesize 128M
max_file_uploads 20
Getting no error .Please help
I think Brijal Savaliya is right, you change the POST_MAX_SIZE along with MAX_EXECUTION_TIME etc to higher values, you can do this by two ways...
Use PHP Code
Change PHP.ini
By PHP Code
//You can write a code to change this value by function
ini_set('POST_MAX_SIZE',128M);
ini_set('MAX_EXECUTION_TIME ',300);
Edit in PHP.ini file
POST_MAX_SIZE = 128M
MAX_EXECUTION_TIME = 300

Changing post_max_size to 512M not being affected on WAMP

I have read other answers here on stackoverflow, however this is a really weird issue.
My phpinfo() shows that I have set 512M for the post_max_size (I have also increased other properties to at least 512M)
However when I am trying to send post request from Angular HTTP to Laravel 5.2 api, I get 422 Unprocessed Entitym and php_error says:
PHP Warning: Unknown: POST Content-Length of 7323588 bytes exceeds the limit of 3145728 bytes in Unknown on line 0
I have changed both php.ini files,despite only one being loaded.
Step 1: Go to the folder destination where you have installed WAMP. (Usually it is C:)
Step 2: Now locate and open php.ini files from both these locations. (C:\wamp\bin\apache\Apache2.4.4\bin and C:\wamp\bin\php\php5.4.16)
Step 3: Now in both the documents press CTRL+F and find out the following settings.
post_max_size
upload_max_filesize
memory_limit
For example you will see upload_max_filesize = 2m where m is MB. Change 2m to 500m or more as you like.
Change post_max_size = 8m to post_max_size = 700m or more. Change memory_limit = 8m to memory_limit = 1000m.
Other than that to avoid fatal errors like maximum time of something exceeded in line something, find and change the following values.
max_execution_time = 30 to to max_execution_time = 3000 and max_input_time = 60 to 3000.
This was an interesting problem.
The issue was following:
Yes, I needed to change the post_max_size, however at one point in my php.ini I had it set to 1000M.
My Apache 2.4.9 , and PHP 5.5.12 decided to ignore the suffix M and I ended up with a limit of 1000 Bytes.
My solution was to set post_max_size = 1000000 to have the limit set to 1MB

PHP Cannot upload file larger than 40MB

On my site, I'm allowing file uploads. I've successfully uploaded a 40 MB file.
But I've been trying to upload a file above 40 mb
In my php.ini, I have the following:
upload_max_filesize = 10G
post_max_size = 10G
max_execution_time = 60
max_input_time = 10000
memory_limit = -1
I work on window server.
I tried a 100mb file. It failed every time.
Instead of
post_max_size = 10G
Try this
upload_max_filesize = 40M
Don't use too big size 10G ,Try with 100M
Are you using php > 5.1. The G modifier is available since PHP 5.1.0.
I think your php doesn't correctly parse the G you are using.
Try:
upload_max_filesize = 10000M
post_max_size = 10000M
Are you sure you want to allow 10 gigabyte? Better to define something close to the max file size you are using. So if it is something like 40 megabyte use 50M.

limit for uploading files [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
POST Content-Length exceeds the limit
PHP Warning: POST Content-Length of 113 bytes exceeds the limit of -1988100096 bytes in Unknown
I have form for upload images, I testing and if I upload image, where have for example 9 mb size, php returns error:
POST Content-Length of 10194008 bytes exceeds the limit of 8388608 bytes in Unknown on line 0
I want that dont upload files more than 2 mb, in first line I have this code:
if (!empty($_FILES['main_photo']['name'])) {
if ( $_FILES['main_photo']['size'] > 1024 * 1024 * 2 ) {
header("Location: index.php");
exit();
}
}
but this error still displayed, please tell what make, I want if file more than 2 mb, just:
header("Location: index.php");
In php.ini look for upload_max_filesize and post_max_size and set to a suitable size:
upload_max_filesize = 20M
post_max_size = 20M
Only after that changes you can add your redirection code.
If you can't access your php.ini (shared hosting) try in .htaccess:
php_value upload_max_filesize 20M
php_value post_max_size 20M
The file you are trying to upload is larger than the configured size set in php.ini. Go inside of php.ini and modify these values to 2mb or greater to allow larger uploads:
upload_max_filesize
post_max_size <-- This one appears to be your biggest issue
Then your code should work.
Your server probably has setting to limit size to 8 megabytes, I think you code is ok. its a server problem try setting the upload_max_filesize using ini_set to something more. If you are one a commercial server , not your own, try contacting administrator

Categories