Not able to upload csv bigger than 8MB file - php

I have created a custom module in magento and it has an option of import csv file.
it uploads file upto 8MB but when i try to upload bigger than 8MB file, it uploads the file in directory but doesn't make any entry in database.
I have set those configuration in php.ini but still no luck.
php_value upload_max_filesize 20M
php_value post_max_size 24M
php_value max_input_time 300
php_value max_execution_time 3000
Please help

Related

The uploaded file exceeds the upload_max_filesize directive in php.ini. Unable to upload a new theme in wordpress

I am unable to upload a new theme in wordpress.The maximum limit showing right now is 10 mb. What changes should I make in CPanel. I have created a new file in Public_html named php.ini.
and pasted these lines.
upload_max_filesize = 256MB
post_max_size = 32M
memory_limit = 32M
max_execution_time = 300
1: Theme Functions File
There are cases where we have seen that just by adding the following code in theme’s functions.php file, you can increase the upload size:
#ini_set( 'upload_max_size' , '64M' );
#ini_set( 'post_max_size', '64M');
#ini_set( 'max_execution_time', '300' );
2. Create or Edit an existing PHP.INI file
For this method you will need to access your WordPress site’s root folder by using FTP or File Manager app in your hosting account’s cPanel dashboard.
In most cases if you are on a shared host, then you will not see a php.ini file in your directory. If you do not see one, then create a file called php.ini and upload it in the root folder. In that file add the following code:
upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 300
This method is reported to work for many users. Remember if 64 doesn’t work, then try 10MB (sometimes that work).
3. htaccess Method
Some people have tried using the .htaccess method where by modifying the .htaccess file in the root directory, you can increase the maximum upload size in WordPress. Edit the .htaccess file in your WordPress site’s root folder and add the following code:
php_value upload_max_filesize 64M
php_value post_max_size 64M
php_value max_execution_time 300
php_value max_input_time 300
Using .htaccess file in wordpress. You can define below lines,
Open it .htaccess in folder and added the following into a newline at the end of the file.
php_value memory_limit 256
php_value upload_max_filesize 64M
php_value post_max_size 64M
php_value max_execution_time 300
php_value max_input_time 1000
Save your changes and overwrite the .htaccess file.
Get More info, you can follow the link,
For upload file size: https://www.bitcatcha.com/blog/increase-maximum-upload-file-size-in-wordpress/
For Increase Memory Limit size :https://premium.wpmudev.org/blog/increase-memory-limit/
you can create php.ini file in wp_admin folder in root wordpress directory
open php.ini and override these values
1- upload max size
2- post max size
3- max execution time
now php.ini file looks like that
upload_max_filesize = 128M
post_max_size = 128M
max_execution_time = 180

Issues with wordpress Max upload size

So I have wordpress plugin that sets my max upload file size and currently it is set to 536mb. (which should be more then enough) But still when I try to upload 3,3 mb .xml file I get an error:
The uploaded file exceeds the upload_max_filesize directive in php.ini.
When trying to Upload
I had the same problem. I tried editing the wp-config.php file and added:
define('WP_MEMORY_LIMIT', '32M');
edited the .htaccess and added:
php_value upload_max_filesize 32M
php_value post_max_size 32M
php_value max_execution_time 300
php_value max_input_time 300
none of the above seemed to work for me. I also tried locating the php.ini file on my directory but couldn't find it.
I created my php.ini file and added:
php_value upload_max_filesize 64M
php_value post_max_size 32M
still nothing changed.
MY SOLUTION
I went back to my cPanel home page and located the MultiPHP INI Editor under the SOFTWARE tab, selected my domain name from the dropdown menu and opened its PHP configuration, scrolled down to the bottom and located the upload_max_filesize directive and changed it from 2MB to the size i want.
That solved my problem. Hope it works for you as well
Open the php.ini file on your hosting server (Typically located somewhere like:
/usr/bin/php5/bin/php.ini in Linux) and adjust the following lines:
; Maximum allowed size for uploaded files.
upload_max_filesize = 536M
; Must be greater than or equal to upload_max_filesize
post_max_size = 536M

php upload maximum size file using php.ini file and .htaccess

upgrade upload_max_filesize
currently show 2M
i Want To 50M
php.ini code
upload_max_filesize=30M;
.htaccess file code
php_value upload_max_filesize 30M
but these file is not work
if i upload .htaccess file then show 500 server error .
please sol this problem thanks .
PHP has several configuration options to limit resources consumed by scripts. By default, PHP is set to allow uploads of files with a size of 2MB or less.
Try increasing the following values in php.ini, for example:
memory_limit = 32M
upload_max_filesize = 32M
post_max_size = 32M
If you want to set those values only for specific project then do it in .htaccess file otherwise set values in php.ini file
.htaccess file should be:-
php_value post_max_size 32M
php_value upload_max_filesize 32M
set the value of upload_max_filesize and post_max_size in your php.ini:
Maximum allowed size for uploaded files.
upload_max_filesize = 50M
Must be greater than or equal to upload_max_filesize
post_max_size = 50M

File upload not working on server in php

I am facing a problem while uploading a file/ image in PHP. When I uplopad an 8kb file it works fine but when I upload more that 50kb file it keeps on loading and do nothing, I have checked upto 5 mins. The path to phpinfo() on my server is http://kogd.tw/jatin.php
I have tried to set following variables in my .htacess file but nothing worked.
php_value file_uploads On
php_value memory_limit 1024M
php_value upload_max_filesize 64M
php_value post_max_size 64M
php_value max_execution_time 300
php_value max_input_time 300
Can anyone please help me regarding it.
To know the problem more, please try to upload a file on link http://kogd.tw/jatin_upload.php
You can try to cahnge de default values with ini_set
ini_set("upload_max_filesize","60M");
ini_set("post_max_size","64M");
change the MB whatever you want to.

uploading large file in php

I need to make a module for uploading files with type *.flv in PHP.
I have been successful in uploading small files but am unable to upload large files.
I have updated PHP values like
php_value memory_limit 120M
php_value max_execution_time 120
php_value upload_max_filesize 10G
php_value post_max_size 10G
php_value max_input_time 500
I am doing a file upload using PHP, which works fine for a file of size 2.8MB on my localhost - but not my Mediatemple GS host. Files smaller than 2MB work fine, but anything larger seems to not work. I am not getting any error message but when the upload finishes, the file is not found in the uploads directory.
I searched around, and added the following lines to the .htaccess file:
php_value memory_limit 120M
php_value max_execution_time 120
php_value upload_max_filesize 10G
php_value post_max_size 10G
php_value max_input_time 500
but it is still not working. Please help.
Maybe your max_execution_time is more 2 minutes !
check how time your script run.
Usually for upload big file developper use FTP or host sharing. (megaupload/rapidshare/...)
i guess all you need is
ini_set("memory_limit","2048M"); # 2 GB
set_time_limit(0); # unlimited exec time
i read somewhere in PHPdocs that it only allows upto 2GB file transfer

Categories