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.
- PHP | $_FILES Array (HTTP File Upload variables)
- Perl | File Upload in CGI
- How to Upload File using formidable module in Node.js ?
- File Upload in ElectronJS
- Angular File Upload
- How to select and upload multiple files with HTML and PHP, using HTTP POST?
- Upload Progress Bar in PHP
- How to Upload Image into Database and Display it using PHP ?
- How to upload files asynchronously using jQuery?
- How to upload Laravel App to Heroku Cloud Application Platform
- Associate user to its upload (post) in Django
- Upload and Retrieve Image on MongoDB using Mongoose
- Django - Upload files with FileSystemStorage
- Node.js | Image Upload, Processing and Resizing using Sharp package
- How to upload files using jQuery Dropzone Plugin ?
- Change the size and position of button in Kivy
- How to change the font size of a text canvas using Fabric.js ?
- How to change font size depending on width of container?
- How to change/update image size dynamically using amp-bind in Google AMP ?
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.