My problem is that when I check to wp-admin/media-new.php I see Maximum upload file size: 8 MB. Now I change the php.ini located at /usr/lib/php.ini I change the upload_max_filesize to 64M and post_max_size 64M. Then when I checked back to wp-admin/media-new.php it is now 'Maximum upload file size: 15M' it should be 64M
I even try following this http://www.wpbeginner.com/wp-tutorials/how-to-increase-the-maximum-file-upload-size-in-wordpress/ but it doesn't help it. it looks like it is limited to 15M? I try to change the post_max_size to 14M then it reads now on wp-admin/media-new.php to 'Maximum upload file size: 14M' it looks like it only limits to 15M. I restarted the apache but still it won't work and it only shows 15M
I checked the phpinfo() and the file loaded is correct which is /usr/lib/php.ini
Is there any settings in wordpress that is limiting the upload file size except on the network setting? no right? What could be the problem?
I Fixed my issues. Here are what I've learned:
1) Make sure there are no conflict with your php.ini.. I checked my phpinfo() and the file loaded is /usr/local/lib/php.ini however there is php.ini placed in the wp-admin/ folder so I deleted it and this cause overriding the setting.
2) If you are running multisite make sure that 'Max upload file size' option in wp-admin/network/settings.php is correct based on your desire cause this will reflect in the main site.
You can use this cod ein .htaccess file.
<IfModule mod_php5.c>
php_value post_max_size 128M
php_value upload_max_filesize 128M
php_value memory_limit 500M
</IfModule>
Change file size as your requirement.
I hope this will work for you.
Related
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
I am working on increasing the max upload file size for a SilverStripe site as I want the new limit to be 20 MB instead of 2 MB. I have placed this line of code in the root .htaccess file for the project:
php_value upload_max_filesize 20M
This works to some extent. It has increased the upload size limit, but only to 8 MB. I removed this line of code and tried uploading a large file again and the "file size exceeds 2 MB" error returned. So, what I have in place does work but only increases the file size limit to 8 MB.
I have been reading that there can be a php.ini file included in the project to increase the file size limit as well, but I am wondering if there is a way to do it through just the .htaccess file?
The reason for this problem is because you've not set your post_max_size. The post_max_size defaults to 8mb. So you need to do the following:
php_value upload_max_filesize 20M
php_value post_max_size 50M
You can obviously edit the post_max_size to something more suitable to what you need.
This 100% work in v4
Your problem is indeed related to php.ini.
In php.ini there is a section related to file uploads that will have the following line in it;
; Maximum allowed size for uploaded files.
upload_max_filesize = 2M
Change the 2M to be something more in line with what you need, then restart apache and you should be good to go.
It is also possible (though i have not tried this yet) to put the following line in to the .htaccess.
php_value upload_max_filesize 20M
Hope that helps.
I have a problem with adding multiple files on my server. Everything works fine on smaller files (<20MB). They are uploading on the server and into my data base without any errors or problems. But when I want to add files bigger than 20MB (for example 10 files, 2,2MB each) uploading doesn't work. There is no error, just nothing is sended via _POST. I tried to change php.ini files, but it is still the same problem.
I've increased:
max_execution_time to one hour
max_file_uploads to 100 files
memory_limit to 512M
output_buffering to 30M (earlier I've turned it off)
post_max_size to 64MB
upload_max_filesize to 64M
The website is on OVH hosting, so every changes I've made in .user.ini file. When I'm trying phpinfo() it shows values which I've changed.
Anyone knows any solution?
in your .htaccess file, this allow me to add upto 2 GB
php_value upload_max_filesize 2048M
php_value post_max_size 2048M
php_value max_execution_time 259200
I wanted to increase the file upload size limit in wordpress without editing php.ini
So I tried adding .htaccess to the wp-content/uploads directory with rules like these:
php_value upload_max_filesize 10M
php_value post_max_size 20M
php_value memory_limit 32M
This doesn't work in wp-content/uploads, the upload max is still 2MB
This does work if I put this in the websites .htaccess file though.
Why won't this work if I just put the htaccess in the uploads directory? Are there any risks in increasing the upload size for the entire site?
.htaccess won't work unless the PHP script handling the upload exists at wp-content/uploads/ (which it does not). Placing it in that folder does not have the result you may expect because it only impacts scripts located in that folder.
You might try placing .htaccess file into /wp-admin/ which will change upload settings for all files handled inside the admin PHP scripts.
Unclear from your post where else users may be uploading files... are you using upload forms in your public-facing website? If so, you may not want to update the settings server-wide. If not, I see no big risks in making the change.
For increase PHP's file upload limit.
In php.ini file, change the parameter to whatever size you need
(example: )
upload_max_filesize = 32M
...
Simply create blank text file. Save As php.ini
Inside the text file copy-paste the following:
upload_max_filesize = 32M
post_max_size = 32M
============================
Unable to access root directory , than
add this to top of wp-config.php
define('WP_MEMORY_LIMIT', '64M');
To Increase the Maximum file size upload in wordpress
find the php.ini location
#find / -iname php.ini
Get into the folder By default it is 2M we can incerase by setting value to the parameter
#vim php.ini
upload_max_filesize = <Userdefined size> (For eg 20M)
post_max_size = <Userdefined size >
Then if you are using php7.0 restart php7.0-fpm service
#systemctl reload php7.0-fpm.service
If .htaccess not change value and also php.ini not change values, search for .user.ini file in root folder server and search for upload_max_filesize and post_max_size values and replace them.
For increasing PHP's file upload limit.
Go to wordpress root directory and open .htaccess file. In my case it was found in /var/www/html
php_value upload_max_filesize 128M
php_value post_max_size 128M
php_value memory_limit 256M
php_value max_execution_time 300
php_value max_input_time 300
The above code increased my file upload limit to 128 MB in wordpress
2021:
Access /etc/php/8.0/apache2/php.ini
Increase the value of post_max_size. The default value is 8M.
Restart the server with sudo service apache2 restart
Try to add this to functions.php of your theme
#ini_set( 'upload_max_size' , '10M' );
#ini_set( 'post_max_size', '20M');
#ini_set( 'memory_limit', '32M' );
I am using wamp as my test server and when trying to upload videos I am getting an error code 1 which is an error saying that my max file size is to small. I changed my php.ini settings to
; Maximum allowed size for uploaded files.
upload_max_filesize = 700000000000000000M
and i changed my htacess file to say this ..
RewriteEngine On
php_value post_max_size 1000000000000000000M
php_value upload_max_filesize 1000000000000000000M
php_value max_execution_time 60000000000000
So there is plenty of room I don't understand why i still get this error .. Thanks in advance for the help.
Were you sure that you restarted Apache after you edited the php.ini file?
Apache loads the php.ini on start so if you made changes without restarting Apache the changes will not take effect.