Are you having issues uploading large files? Do you receive an error about exceeding a maximum upload file size? Are you trying to increase the upload max filesize for a WordPress website, or PHP website?
The best way to increase the PHP Upload Max Filesize is by creating or editing a PHP.ini file in the directory. This may include the root directory of the website, as well as /wp-admin, or others depending on your website’s configuration.
- Create or edit
php.ini
file inside of applicable directories. - Add the following lines:
upload_max_filesize=128M;
post_max_size=130M;
memory_limit=256M;
max_execution_time=300;
max_input_time=300;
upload_max_filesize
is the maximum size of file you want to allow to be uploaded on your website (through scripts/forms, this does not affect FTP uploads).post_max_size
will include other data about the file transfer and server-client communication, so should always be larger than upload_max_filesize.
memory_limit should be larger than post_max_size.max_execution_time
and max_input_time
are in seconds, and indicated how long a script/process can run (ie, uploading script).
Note: If you also plan on uploading a lot of files at once, it may be required to also specify or increase the max_input_vars:
max_input_vars=1000;