Changing the upload limit: Difference between revisions
Jump to navigation
Jump to search
(Created page with "==php== Upload limit is configured in the <code>php.ini</code> config file. To find it: $ php --ini To edit it: $ sudo nano /etc/php/7.4/cli/php.ini And the search for: * <code>upload_max_filesize</code> * <code>post_max_size</code> Then restart php: $ sudo service php7.4-fpm restart") |
No edit summary |
||
(4 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
See the MediaWiki documentation: https://www.mediawiki.org/wiki/Manual:Configuring_file_uploads#Set_maximum_size_for_file_uploads | |||
==php== | ==php== | ||
The php upload limit is configured in the <code>php.ini</code> config file. | |||
To find it: | To find it: | ||
Line 15: | Line 17: | ||
* <code>upload_max_filesize</code> | * <code>upload_max_filesize</code> | ||
* <code>post_max_size</code> | * <code>post_max_size</code> | ||
and change the values. | |||
Then restart php: | Then restart php: | ||
$ sudo service php7.4-fpm restart | $ sudo service php7.4-fpm restart | ||
==Localsettings.php== | |||
The MediaWiki upload limit is also configured in the LocalSettings file. | |||
$ sudo nano /var/www/html/wiki/LocalSettings.php | |||
Search for: | |||
* <code>$wgUploadSizeWarning</code> | |||
* <code>$wgMaxUploadSize</code> | |||
and change the values. | |||
The values are written in Bytes, this page can be used to convert mb's to bytes: https://www.gbmb.org/mb-to-bytes | |||
[[Category:Sysadmin]] | |||
==nginx== | |||
Nginx also handles maximum file uploads. You can configure this maximum in the nginx conf file: | |||
$ sudo nano /etc/nginx/sites-enabled/default | |||
And then add in a server or location block: | |||
client_max_body_size 5M; | |||
Check if the nginx config is oke: | |||
$ sudo nginx -t | |||
And if so, reload nginx: | |||
$ sudo service nginx reload |
Latest revision as of 16:08, 8 November 2023
See the MediaWiki documentation: https://www.mediawiki.org/wiki/Manual:Configuring_file_uploads#Set_maximum_size_for_file_uploads
php
The php upload limit is configured in the php.ini
config file.
To find it:
$ php --ini
To edit it:
$ sudo nano /etc/php/7.4/cli/php.ini
And the search for:
upload_max_filesize
post_max_size
and change the values.
Then restart php:
$ sudo service php7.4-fpm restart
Localsettings.php
The MediaWiki upload limit is also configured in the LocalSettings file.
$ sudo nano /var/www/html/wiki/LocalSettings.php
Search for:
$wgUploadSizeWarning
$wgMaxUploadSize
and change the values.
The values are written in Bytes, this page can be used to convert mb's to bytes: https://www.gbmb.org/mb-to-bytes
nginx
Nginx also handles maximum file uploads. You can configure this maximum in the nginx conf file:
$ sudo nano /etc/nginx/sites-enabled/default
And then add in a server or location block:
client_max_body_size 5M;
Check if the nginx config is oke:
$ sudo nginx -t
And if so, reload nginx:
$ sudo service nginx reload