{kun´ēzē}
 
(Reading time: 8 - 16 minutes)
24Jun2023

Absurdly wrong PHP settings that people use … and wonder why they have problems!

Information
3207 hits Updated: 26 June 2023 Blog

Article Index

Max. upload size = 2M; Max. POST size = 8M

What do Max. upload size and Max. POST size mean?

Max. upload size corresponds to the PHP setting upload_max_filesize; Max. POST size corresponds to the PHP setting post_max_size.

The online PHP guide says

upload_max_filesize

  • The maximum size of an uploaded file.

and

post_max_size

  • Sets max size of post data allowed. This setting also affects file upload. To upload large files, this value must be larger than upload_max_filesize. Generally speaking, memory_limit should be larger than post_max_size.

Typically, on new installations of PC-hosted web servers (e.g. Wampserver, XAMPP, LAMP and the like) and some commercial web servers, upload_max_filesize has an initial value of 2M and post_max_size is initially 8M.  While these initial values may be sufficient to allow the new installations of J! to be done, they are not sufficiently large enough to allow those J! websites to be updated later or large enough to allow some third-party extensions to be installed.

The crunch comes when it's time to update the version of J! that you're currently using.

How to find the values of Max. upload size and Max. POST size used by your J! website

There are several ways to obtain this information:

  • Go to System » System Information » PHP Settings and search for and “Upload Max Filesize” and “Post Max Size”.
  • If you have access to you web host's cPanel (or something similar with a PC-hosted AMP stack like Wampserver) look for PHP settings with the version of PHP you're using.
  • Run the Forum Post Assistant reporting tool.

Remedy

Set or change Max. upload size and Max. POST size to “reasonable” values; I recommend setting upload_max_filesize to 64M and post_max_size twice that value (i.e. 128M) as a something sensible to begin with. Don't go "overboard" and set a ridiculously high value (e.g. greater than PHP's memory_limit).

Setting ideal values for Max. upload size and Max. POST size may require some trial and error and you may have to experiment.  I would suggest that post_max_size should be set to be no more than half the value of memory_limit and upload_max_filesize should be set to half the value of post_max_size.   The main point is to set values that allow you to manage your Joomla website and carry out everyday maintenance activities such as updating extensions or updating the core CMS.

Known problems

J! 4.x update packages are quite large (and getting bigger all the time); at the time of writing, the update package [ZIP format] for J! 4.3.2 is 29.3 Mb. Therefore, Max. upload size must be greater than this number and, correspondingly, Max. POST size must also be increased.  Likewise, some third-party extension installations/updates can be big, too.

While it's possible to run with Max. upload size set to 32M, there's no guarantee that this value will accommodate future updates of Joomla.

If these matters did not cause problems I would not have written this article.  My advice is to check the PHP settings for upload_max_filesize and post_max_size and set them (or change them) accordingly.  If more people carried out these simple checks then we would probably see fewer questions about the same kinds of problems that we often see.

About the author:

has worked in the information technology industry since 1971 and, since retiring from the workforce in 2007, is a website hobbyist specialising in Joomla, a former member of the Kunena project for more than 8 years and contributor on The Joomla Forum™. The opinions expressed in this article are entirely those of the author. View his profile here.


No thoughts on “Absurdly wrong PHP settings that people use … and wonder why they have problems!”

User Rating: 4 / 5

Star ActiveStar ActiveStar ActiveStar ActiveStar Inactive
 
Trending now