Skip to content

danielcregg/wp-increase-upload-limit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

WordPress Increase Upload Limit

WordPress PHP Apache Bash License: MIT

A quick-reference guide with ready-to-use commands for increasing the file upload size limit in WordPress by modifying PHP configuration on Apache servers.

Overview

WordPress enforces file upload limits based on the underlying PHP configuration. By default, these limits can be restrictive when uploading large media files, themes, or plugins. This repository provides a one-liner set of sed commands that update the relevant PHP settings and restart Apache so the changes take effect immediately.

Features

  • Increases upload_max_filesize to 512 MB
  • Increases post_max_size to 512 MB
  • Extends max_execution_time to 300 seconds
  • Extends max_input_time to 300 seconds
  • Automatically creates backup files (.bak) of the original php.ini before making changes
  • Restarts Apache to apply the new configuration

Prerequisites

  • A Linux server running Apache with PHP (e.g., Ubuntu, Debian)
  • WordPress installed and configured
  • sudo privileges on the server
  • PHP installed via the system package manager (configuration at /etc/php/*/apache2/php.ini)

Getting Started

Installation

No installation is required. Simply copy and run the commands below on your server.

Usage

Run the following commands on your WordPress server:

sudo sed -i.bak -e 's/^upload_max_filesize.*/upload_max_filesize = 512M/g' /etc/php/*/apache2/php.ini;
sudo sed -i.bak -e 's/^post_max_size.*/post_max_size = 512M/g' /etc/php/*/apache2/php.ini;
sudo sed -i.bak -e 's/^max_execution_time.*/max_execution_time = 300/g' /etc/php/*/apache2/php.ini;
sudo sed -i.bak -e 's/^max_input_time.*/max_input_time = 300/g' /etc/php/*/apache2/php.ini;
sudo service apache2 restart

After running the commands, verify the new limits by navigating to WordPress Admin > Media > Add New or by checking the PHP info:

php -i | grep -E "upload_max_filesize|post_max_size|max_execution_time|max_input_time"

Tech Stack

  • WordPress -- Content management system
  • PHP -- Server-side scripting language powering WordPress
  • Apache -- Web server hosting the WordPress site
  • Bash -- Shell commands for automated configuration

License

This project is licensed under the MIT License.

About

Quick-reference commands for increasing WordPress file upload limits by modifying PHP configuration on Apache servers

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors