Wordpress Download File Size

I am noob and use Wordpress in the Google Cloud. When I try to download a new topic, I get the following error message:

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

This limitation is apparently set by the Google Compute Engine. I found information about the restriction set in the php.ini , but I can not find this file anywhere.

Can someone give an idiot proof, step-by-step instructions to increase the upload size beyond 2 MB? I installed WP plugins that should do this, but the problem should be on the server side.

+5
source share
5 answers

I am not sure which operating system you are using or which version of PHP you are using. I am running an instance of Ubuntu 12.04 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 step 3. Look for it.

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

Strive for the smallest number YOU NEED, and keep in mind that PHP has a different parameter elsewhere that sets how long it will wait before the timeout. You can set a 2G download limit, but if your timeout is 30 seconds, you still fail if you cannot download 2G in 30 seconds. As a rule, try low.

  1. Type Ctrl X to exit, save the file changes.
  2. Restart PHP by typing service php5-fpm restart
+7
source

On the toolbar of the Google Developer Console, on the left, under the "Calculate" section there is an instance of MV

  • click to view all parameters of your instance.
  • click the ssh button to access your server.
  • Find in the / -name php.ini feed to find the directory of your php.ini
  • sudo nano tape in my case it was sudo nano / etc / php5 / apache2 / php.ini
  • find the line upload_max_filesize = 2M and change it to 20M or more.
  • restart the server when you restart sudo / etc / init.d / apache2.

It worked for me!

+4
source
  • Install the Google Cloud SDK (GCS) https://cloud.google.com/sdk/gcloud/
  • GCS: setting up an account in the Google Cloud SDK gcloud auth login
  • Get connection string from web console https://console.developers.google.com

    • YourProject> Compute> Compute Engine> virtual machine instances
    • In the instance line: connect / SSH> popup menu> view gcloud command
    • Copy gcloud command line
  • GCS: run it in the Google Cloud SDK to open SSH gcloud compute --project "your_project-id" ssh --zone "us-central1-a" "wordpress-your_id"

  • GCS: Copy php.ini to your localhost: gcloud compute --project "your_project-id" copy-files "wordpress-your_id":/etc/php5/apache2/php.ini php.ini --zone "us-central1-a"
  • Edit the upload_max_filesize = 2M in php.ini located in the Cloud SDK folder

  • GCS: Download back to the host in your home directory: gcloud compute --project "your_project-id" php.ini copy-files "wordpress-your_id":~/php.ini --zone "us-central1-a"

  • SSH: change user to root in PuTTY: sudo /bin/bash

  • SSH: Replace php.ini: cp php.ini /etc/php5/apache2/php.ini
  • SSH: reboot service apache2 restart : service apache2 restart
+2
source

I took the following steps

  • In the terminal console you need to edit the correct php.ini, in my case it was:

    vi / etc / php5 / apache2 / php.ini

    1. I did a search and changed the upload_max_filesize and post_max_size variables as follows:

post_max_size = 256M

upload_max_filesize = 256M

I restarted the Apache server

/etc/init.d/apache2 restart

And work for me.

0
source

You need to know how Google products work.

At least you can control two things.

  • The memory that WP itself will try to use as max: define('WP_MEMORY_LIMIT', '256M');
  • The value of the container you are using (600Mhz / 128Mb for free use).

Even if he works with PHP, he uses his own Python-based infrastructure and uses his own configuration files. Thus, .htaccess or php.ini will not be handled here. Just configuration files, which you can read about in the documentation.

In any case, I’m watching people’s messages and know that you can at least run 128Mb of the minumun instance. In addition, I do not recommend you use AppEngine to host your blog.

-1
source

Source: https://habr.com/ru/post/1211386/


All Articles