Increase Upload Size in WordPress through SSH

IGANI Co.
2 min readSep 15, 2023

--

IGANI CO: Increase Upload in WordPress Through SSH

Is your WordPress website limiting your file upload size? You can change that by adjusting your server settings through SSH. In this comprehensive guide, we’ll walk you through the process step by step.

Prerequisites

  1. SSH Access: Ensure you have SSH access to your server.
  2. WordPress Site: You should have a WordPress site installed on your server.

Step 1: Connect to Your Server

Use your terminal or command prompt to establish an SSH connection to your server. Replace username with your server username and your-server-ip with your server’s IP address.

ssh username@your-server-ip

Enter your SSH password when prompted.

Step 2: Locate Your PHP Configuration File

You need to locate your PHP configuration file. The path may vary depending on your server setup. Common locations include /etc/php/7.4/apache2/php.ini for PHP 7.4. You can find the correct path with the following command:

php --ini

Look for the Loaded Configuration File entry; it will indicate the path to your php.ini file.

Step 3: Edit the PHP Configuration

Use a text editor (such as Nano or Vim) to edit the php.ini file. Replace /etc/php/7.4/apache2/php.ini with the path you found in the previous step:

sudo nano /etc/php/7.4/apache2/php.ini

Find the following lines and adjust them to your desired values:

upload_max_filesize = 32M
post_max_size = 48M
max_execution_time = 300

Save the file and exit the text editor.

Step 4: Restart Apache

To apply the changes, you need to restart the Apache web server:

sudo systemctl restart apache2

That’s it! Your WordPress site should now allow larger file uploads.

Conclusion

By following these steps, you’ve successfully increased the upload size in WordPress through SSH. Enjoy your improved website functionality!

--

--

IGANI Co.
IGANI Co.

Written by IGANI Co.

Bridging Code, Community & Curriculum, One Pixel at a Time.

No responses yet