GetSimple Support Forum

Full Version: File uploads from the backend fail with files > 5 kb
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
In the GS backend's file tab, I cannot upload files of more than a couple of kilobytes (limit seems to be somewhere around 5 kb). This is even though I have set the following values in my /etc/php5/apache2filter/php.ini:

Code:
file_uploads = On
upload_max_filesize = 50M
max_file_uploads = 20
max_execution_time = 180
max_input_time = 300
memory_limit = 256M
post_max_size = 60M

Of course, I have restarted apache after all changes I tried. (as root: service apache2 restart)
I have frequently checked with <?PHP phpinfo (); ?> that the settings I made are actually active.

But the size limit persists.
Yesterday I accidently found, that the same limit applies in a local drupal test installation (which has been lying around for much longer, and I know it used to work with larger file there), so I assume it is some global settings problem of either php or apache.

I have, too, done a diff with the original php.ini template of package php5-common ( /usr/share/php5/php.ini-production, and the only differences are in the lines quoted above. I am at a loss.

  • GS 3.3.4 is running on my local pc
  • using the define('GSNOUPLOADIFY', 1) option in gsconfig.php
  • System: Debian testing
  • apache2: 2.4.10-9
  • PHP5: 5.6.4+dfsg-1
(2015-01-12, 17:31:16)WerWieWas Wrote: [ rel="nofollow" -> ]... /etc/php5/apache2filter/php.ini:

You seem to have everything in place. Is there a reason for running Apache with mod-apache2filter instead of mod-php5? (Sorry if that's Apache 2.4 specific – I haven't worked with that version.)

Is it coincidence that you have set a limit of 50M but you are seeing an actual limit of 5k?
Are you sure you restarted apache, perhaps something is not applying.
seems correct.

perhaps one of our scripts it setting its own limits?
(2015-01-15, 23:49:54)shawn_a Wrote: [ rel="nofollow" -> ]Are you sure you restarted apache, perhaps something is not applying.
seems correct.

perhaps one of our scripts it setting its own limits?


Hi Shawn.

Yes I am sure I did restart. I have always checked with phpinfo() that the changes I made took effect.
Hi Hameau.

Quote:Is it coincidence that you have set a limit of 50M but you are seeing an actual limit of 5k?

Rather a coincidence: When I started, I had default values set in the php.ini (e.g. 2MB max size for uploads, etc.). Then I increased values according to what I found on the net. The limit where uploads failed remained the same, approx. 5kb.

Quote:Is there a reason for running Apache with mod-apache2filter instead of mod-php5? (Sorry if that's Apache 2.4 specific – I haven't worked with that version.)

This question led me to the solution of my problem: Actually, I vaguely remember wondering in december why I had an empty /etc/php5/apache2 folder and a php.ini in /etc/php5/apache2filter. I have been testing CMSs for my own dormant website on and off for quite a while, starting again in December, this time looking for a specific solution for two small websites where I want a friend and a non-profit to be able to edit their own websites without any HTML/CSS/PHP knowledge and without being IT pros. I guess there must once have been some CMS that asked for php5filter. - The simple solution was:
  • remove libapache2-mod-php5filter
  • install libapache2-mod-php5

I checked without setting up any php.ini at first, right after exiting aptitude.
Uploading files worked nicely (default limit 2MB).
Then I copied my php.ini to /etc/php5/apache2/php.ini, did a

service apache2 restart

for the changes to take effect, checked with phpinfo(); - and voilà: I can upload larger files again (so far, the largest I tried was a couple of MB, but I trust my settings and mod-php now. Big Grin

Thank you for your help!