How to change the maximum uploading size for PHP with Apache on Linux?

How to change the maximum uploading size for PHP with Apache on Linux?

PHP has parameters to control the maximum uploading size. Here, we use Ubuntu 18.04 LTS default version as an example.

First, open the php.ini configuration file using your favorite editor

/etc/php/7.2/apache2/php.ini 

Then, find the following parts

; Maximum size of POST data that PHP will accept.
; Its value may be 0 to disable the limit. It is ignored if POST data reading
; is disabled through enable_post_data_reading.
; http://php.net/post-max-size
post_max_size = 20M
; Maximum allowed size for uploaded files.
; http://php.net/upload-max-filesize
upload_max_filesize = 20M

and change them to the size you prefer.

Last, restart apache2 to make the new parameters take effect.

$ sudo systemctl restart apache2

Similar Posts

  • |

    How sched_setaffinity works inside of Linux Kernel

    Abstract Sometimes, we may want to migrate one process/thread to one specific CPU for some specific purpose. In the Unix/Linux systems, you may choose sched_setaffinity to finish this job. This article will help you to understand how sched_setaffinity (or other APIs like pthread_setaffinity_np in user-space) works internal Linux kernel. Details SYSCALL_DEFINE3(sched_setaffinity, pid_t, pid, unsigned int,…

  • ASCII Table and ASCII Code

    This post gives the ASCII table and ASCII code with ASCII control characters and ASCII printable characters and a tool to convert ASCII codes to ASCII characters. Introduction to ASCII table and ASCII code ASCII stands for American Standard Code for Information Interchange. An ASCII code is the numerical representation of a character since computers…

  • How to make a swap partition

    How to make a swap partition on Linux? First, make a new partition (or reuse an existing one if you like). I suggest using cfdisk to create it: https://www.systutorials.com/docs/linux/man/8-cfdisk/ Then, turn the new partition (say, /dev/sdc1) to a swap # mkswap /dev/sdc1 Lastly, turn it on # swapon /dev/sdc1 You can check whether its status…

  • Managing LVM

    Any tutorials or tips on how to manage LVM? LVM provides a flexible and easy way to management storage disks on Linux. It also provides a set of tools for management. Here are some tutorials and references for managing LVM: LVM man pages: https://www.systutorials.com/docs/linux/man/8-lvm/#lbAL Manage Disk Volume in Linux: http://www.hongkedavid.com/blog/disk_volume.html LVM with Xen: https://www.systutorials.com/b/linux/tag/lvm/ Remove missing phyiscal volumes…