Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wordpress upload file size

I'm a noob and using Wordpress on Google cloud. When attempting to upload a new theme, I get the following error message:

The uploaded file exceeds the upload_max_filesize directive in php.ini.

This is a limitation seems to be set by Google Compute Engine. I've found info about the limitation being set in the php.ini file, but I can't seem to locate that file anywhere.

Can anyone give some idiot proof, step-by-step instructions to increase the upload size beyond 2MB? I've installed the WP plug-ins that should do this, but the problem must be server side.

like image 307
Ronald Meyers Avatar asked Jan 19 '15 05:01

Ronald Meyers


People also ask

How do I increase the maximum upload file size in WordPress cPanel?

In the dropdown, select a PHP version. PHP versions have independent configurations, so you must edit the max upload variable for all versions you wish to change. Scroll to upload_max_filesize and edit the adjacent value before clicking Apply at the bottom of the page. Ensure that post_max_size is at least as large.

How do I increase the maximum upload file size in WordPress all in one plugin?

Open WordPress admin, go to Plugins, click Add New. Enter “increase maximum upload” in search and hit Enter. Plugin will show up as the first on the list, click “Install Now” Activate & open plugin's settings page located in the main admin menu.


1 Answers

I'm not sure what operating system you are using or what version of PHP you are using. I run an Ubuntu 12.04 instance from Amazon Web Services using PHP-FPM. But, the instructions should be basically the same for you. The directory where your php.ini file is saved may be slightly different in item 3. Go hunt for it.

  1. Log in to your server via SSH.
  2. Change user to root: sudo /bin/bash
  3. Edit the php.ini file: nano /etc/php5/fpm/php.ini
  4. Find the line that says upload_max_filesize = 2M . In nano, you can search by typing Ctrl W.
  5. Change to whatever file size you want Whatever you type must have an M (megabytes) or G (gigabytes) at the end (e.g. upload_max_filesize = 200M or =1G).

Aim for the lowest number that you NEED, and keep in mind that PHP has another setting elsewhere that sets how long it will wait before a timeout. You can set a 2G upload limit, but if your timeout is 30 seconds you're still going to fail unless you can upload 2G in 30 seconds. As a general rule, aim low.

  1. Type Ctrl X to exit, save your file changes.
  2. Restart PHP by typing service php5-fpm restart
like image 159
Mooseknuckles Avatar answered Sep 22 '22 19:09

Mooseknuckles