Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 684 Vote(s) - 3.52 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Cannot increase maximum upload file size in local WordPress

#1
I am using my own **localhost** (ubuntu and apache2) for running wordpress 4.8 . I want to increase maximum upload file size. I tried these ways but didn't solve :

1.creating `php.ini` in `/var/www/html` or changing it in `/etc/php/7.0/apache2/php.ini`:

upload_max_filesize = 512M
memory_limit = 512M
post_max_size = 512M
max_execution_time = 300

2.changing `.htaccess` in `/var/www/html`:

php_value upload_max_filesize 512M
php_value post_max_size 512M
php_value max_execution_time 300
php_value max_input_time 300

3.adding these line of codes in `functions.php` file in the theme folder:

@ini_set('upload_max_size' , '512M');
@ini_set('post_max_size', '512M');
@ini_set('max_execution_time', '300');

4.using [Upload Max File Size plugin][1]. this plugin changed `Maximum upload file size: 2 MB.` message but after uploading file more than 2mb the `HTTP error.` accrued. (for fixing this i also tried every solution i found on web (ex: [+][2],[+][3],[+][4]) but nothing changed. also turning on wordpress log cant help me. there wasn't anything!! So i gave up. i think the root of this error is bad fix for this problem)

5.changing permissions of all files and folder to 777.

6.after every fix i tried, i also restart apache but nothing changed:

$ sudo service apache2 restart


[1]:

[To see links please register here]

[2]:

[To see links please register here]

[3]:

[To see links please register here]

[4]:

[To see links please register here]

Reply

#2
you need also to add this filter to the functions.php file to see the allowed upload in your Wordpress , its good to not use plugin :)

//filter
add_filter('upload_size_limit', 'increase_upload');
function increase_upload($bytes) {
return 262144000;
}
Reply

#3
You can change these lines on your `php.ini` file of currently running php version.


Maximum allowed size for uploaded files.
upload_max_filesize = 256M
Reply

#4
I shouldn't create any `php.ini` file in `/var/www/html/`. I found `/etc/php/7.0/apache2/php.ini` path in `phpinfo()` details. So i found and changed these configs in this file : `upload_max_filesize`, `memory_limit`, `post_max_size` and `max_execution_time`.

> NOTE: I was right! `HTTP error.` while uploading media was because of
> bad fix for this problem. now i can upload any media correctly :)
Reply

#5
Go to C:/Xampp/php/php.ini and find:

memory_limit=.....M

Change it to:

memory_limit=10000M

Then scroll down to:

post_max_size=.....M
And change it to:

post_max_size=9999M

Find:

file_uploads=...

If it's of write:

file_uploads=On

Scroll down and find

upload_max_filesize=....M

Write there:

upload_max_filesize=9000M

Also find:

max_file_uploads=.....

And write there:

max_file_uploads=10000M

Attention! Be careful! "Memory_limit" should have the largest number of megabytes. The next is "max_file_uploads", after which is "post_max_size", and last the "upload_max_filesize".

If there is still the same error, make your .htaccess like this:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /your_site_name/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /your_site_name/index.php [L]
</IfModule>

# END WordPress
# WP Maximum Execution Time Exceeded
<IfModule mod_php7.c>
php_value max_execution_time 300

php_value upload_max_filesize 9000M
php_value post_max_size 9999M
php_value max_input_time 300

</IfModule>

Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through