Skip to content
Fix Code Error

Change the maximum upload file size

March 13, 2021 by Code Error
Posted By: Anonymous

I have a website hosted on a PC I have no access to. I have an upload form allowing people to upload mp3 files up to 30MB big. My server side script is done in PHP.

Every time I try and upload a file, I receive an error claiming that the file exceeds the maximum size allowed, so I need to increase the size. My research on the web suggested changing the .htaccess file which I do not have access to, so that won’t work. Others suggested that I should add a custom php.ini file to my root which did not work. Any other suggestions?

Solution

You need to set the value of upload_max_filesize and post_max_size in your php.ini :

; Maximum allowed size for uploaded files.
upload_max_filesize = 40M

; Must be greater than or equal to upload_max_filesize
post_max_size = 40M

After modifying php.ini file(s), you need to restart your HTTP server to use new configuration.

If you can’t change your php.ini, you’re out of luck. You cannot change these values at run-time; uploads of file larger than the value specified in php.ini will have failed by the time execution reaches your call to ini_set.

See the Description of core php.ini directives.

Answered By: Anonymous

Related Articles

  • The null object does not have a method []=
  • Laravel: PDOException: could not find driver
  • How to solve Internal Server Error in Next.Js?
  • getting error while updating Composer
  • PHP7 : install ext-dom issue
  • Reference — What does this symbol mean in PHP?
  • Upload video files via PHP and save them in…
  • Can't install laravel installer via composer
  • How do I get (reasonably recent versions of)…
  • Setting PHP tmp dir - PHP upload not working
  • Adding Dynamic Input Fields With VueJs
  • Convert audio files to mp3 using ffmpeg
  • PHP Warning: Module already loaded in Unknown on line 0
  • laravel vuejs/axios put request Formdata is empty
  • PHP - Failed to open stream : No such file or directory
  • PHP parse/syntax errors; and how to solve them
  • Why the value of input file missing when I input the…
  • XMLHttpRequest cannot load ✘✘✘ No…
  • How to prevent scrolling the whole page?
  • How do I connect to this localhost from another…
  • What are access specifiers? Should I inherit with…
  • Adding a UserCreationForm to html in Django
  • error LNK2005: ✘✘✘ already defined in…
  • Google Forms file upload complete example
  • git lfs push to github failure on Ubuntu 18.04
  • Playing a MP3 file in a WinForm application
  • Neither BindingResult nor plain target object for…
  • Form field border-radius is not working only on the…
  • The requested URL /about was not found on this server
  • How to use PrimeFaces p:fileUpload? Listener method…
  • The definitive guide to form-based website authentication
  • Can someone explain how to implement the jQuery File…
  • Multipart File Upload Using Spring Rest Template +…
  • Laravel App not running on xampp or live server but…
  • apache server reached MaxClients setting, consider…
  • how to toggle class for multiple elements in vue js
  • Ukkonen's suffix tree algorithm in plain English
  • How to submit Polymer forms to PHP and display response
  • To enable extensions, verify that they are enabled…
  • Handling Events for Many Elements - optimalizing my solution
  • How to increase apache timeout directive in .htaccess?
  • Avoid creating new session on each axios request laravel
  • Polymer dom-repeat not rendering changes with…
  • Start redis-server with config file
  • Set up DNS based URL forwarding in Amazon Route53
  • CodeIgniter htaccess and URL rewrite issues
  • Braintree Hosted Fields not rendering on Polymer
  • ExpressJS How to structure an application?
  • How do I count unique visitors to my site?
  • Logging best practices
  • polymer paper-scroll-header-panel doesn't display
  • What are the best JVM settings for Eclipse?
  • Build Polymer App with multiple elements using one…
  • Error creating bean with name
  • Composer require runs out of memory. PHP Fatal…
  • jQuery AJAX file upload PHP
  • Error message "Forbidden You don't have permission…
  • Incorporate JQuery-file-upload to application
  • Play audio from a stream using C#
  • Why is it common to put CSRF prevention tokens in cookies?
  • How to create a search filter using Vue js from API Data?
  • Where does MAMP keep its php.ini?
  • How to return grandchilds names for each person in array JS?
  • How can I condense this Python Tkinter GUI input code?
  • The Logic on How Rekursion Functions with Void…
  • "Notice: Undefined variable", "Notice: Undefined…
  • htaccess deny from all
  • iOS Launching Settings -> Restrictions URL Scheme
  • How to avoid "module not found" error while calling…
  • How to simplify sequential logic design by…
  • Use .htaccess to redirect HTTP to HTTPs
  • No input file specified
  • .htaccess not working apache
  • How many files can I put in a directory?
  • How to deny access to a file in .htaccess
  • How Spring Security Filter Chain works
  • How to pass the id value of an url with axios and…
  • How to upload a file in Django?
  • How to make a SIMPLE C++ Makefile
  • How do I expire a PHP session after 30 minutes?
  • Upload file from VueJS app to API in Laravel
  • jmxterm: "Unable to create a system terminal" inside…
  • How can I enable the MySQLi extension in PHP 7?
  • How to turn off magic quotes on shared hosting?
  • Can't upload files with Apollo-client GraphQL in…
  • How to access the php.ini file in godaddy shared…
  • How to play a sound using Swift?
  • How can I execute PHP code from the command line?
  • Smart way to truncate long strings
  • Ember.js set initial value of property
  • Proper .htaccess config for Next.js SSG
  • Web Application Problems (web.config errors) HTTP…
  • commandButton/commandLink/ajax action/listener…
  • How can I pass modelformset_factory validation in Django?
  • How to check file MIME type with javascript before upload?
  • Convert a PHP script into a stand-alone windows executable
  • How do you parse and process HTML/XML in PHP?
  • How do I change the default index page in Apache?
  • move_uploaded_file gives "failed to open stream:…
  • How do SO_REUSEADDR and SO_REUSEPORT differ?

Disclaimer: This content is shared under creative common license cc-by-sa 3.0. It is generated from StackExchange Website Network.

Post navigation

Previous Post:

Remove Object from Array using JavaScript

Next Post:

Convert string with commas to array

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

.net ajax android angular arrays aurelia backbone.js bash c++ css dataframe ember-data ember.js excel git html ios java javascript jquery json laravel linux list mysql next.js node.js pandas php polymer polymer-1.0 python python-3.x r reactjs regex sql sql-server string svelte typescript vue-component vue.js vuejs2 vuetify.js

  • you shouldn’t need to use z-index
  • No column in target database, but getting “The schema update is terminating because data loss might occur”
  • Angular – expected call-signature: ‘changePassword’ to have a typedeftslint(typedef)
  • trying to implement NativeAdFactory imports deprecated method by default in flutter java project
  • What should I use to get an attribute out of my foreign table in Laravel?
© 2022 Fix Code Error