Thursday, October 23, 2025
HomeLanguagesHow to change the maximum upload file size in PHP ?

How to change the maximum upload file size in PHP ?

The maximum size of any file that can be uploaded on a website written in PHP is determined by the values of max_size that can be posted or uploaded, mentioned in the php.ini file of the server. In case of hosted server need to contact the administrator of the hosting server but XAMPP has interpreters for the scripts written in PHP and Perl. It helps to create local http server for developers and it provides them full physical and administrative access to the local server. Hence it is the most widely used server and it is very easy to increase the limit on upload files to the desired value in this server.

The error is generally thrown as follows:

Steps to change file upload size: In case of local server

  • Open C drive with administrative access and then open xampp folder.
  • Click on the folder php and open php.ini file in editor mode (like Notepad or Wordpad ).

  • In php.ini file search the keyword upload_max_filesize and update its value to the desired file size of a single attachment of largest size. By default, its value is set to 2 MB maximum.
  • Then search the post_max_size keyword and update its value to the maximum required value which is the size of the whole content and attachments included in the post.
  • Save the changes made and restart the server (XAMPP).

Note: The upload_max_size limits the size of single attachment and post_max_size is the limit for all the content of the post.

RELATED ARTICLES

Most Popular

Dominic
32361 POSTS0 COMMENTS
Milvus
88 POSTS0 COMMENTS
Nango Kala
6728 POSTS0 COMMENTS
Nicole Veronica
11892 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11954 POSTS0 COMMENTS
Shaida Kate Naidoo
6852 POSTS0 COMMENTS
Ted Musemwa
7113 POSTS0 COMMENTS
Thapelo Manthata
6805 POSTS0 COMMENTS
Umr Jansen
6801 POSTS0 COMMENTS