0

I'm testing a file uploading page etc that I'm working on. Chose a largish file at random and received:

Request Entity Too Large

The requested resource
/admin.php
does not allow request data with POST requests, or the amount of data provided in the request exceeds the capacity limit.

as an error message. Brief google led to changing values in php.ini but I can't locate or access it.

The site is hosted on a free site 000.webhosting.org - I'm guessing they have it restricted somehow. Is there a workaround?

null
  • 3,469
  • 7
  • 41
  • 90
  • 1
    You can't get access to php.ini on a free host. Even many paid hosts don't allow you to access that. – Fallen Jul 23 '13 at 22:27
  • @Fallen - OK. ANy way around the max upload size then? – null Jul 23 '13 at 22:28
  • I believe there's no way to increase `upload_max_filesize` from php code. For further reference: http://stackoverflow.com/questions/1122418/changing-upload-max-filesize-on-php – Fallen Jul 23 '13 at 22:29
  • unfortunately, no workaround for this issue. It is a protection mechanism set by this type of hosts to protect themselves from massive/multiple uploads that could affect both bandwith and lock a server thread too long. – Paul Jul 23 '13 at 22:33
  • @Paul - OK. To be honest it's only a server that I'm using for testing and so on, the site will be migrated to a paid service where hopefully settings will be more pliable – null Jul 23 '13 at 22:37

1 Answers1

0

Create an .htaccess document and put it in you document root directory. Inside, place:

php_value upload_max_filesize 10M

Source: http://www.cyberciti.biz/faq/linux-unix-apache-increase-php-upload-limit/

Honestly, I've never tried this, but it appears to be what you need.

Edit:

Here's something else I found, you can try: ini_set("upload_max_filesize", "xM"); where x is a number and the M signifies Megabytes. I'm not sure if it works with all versions, but it's listed as being editable on the php website (http://www.php.net/manual/en/ini.list.php).

David
  • 1
  • 1
  • Making any changes to the htaccess except errorDocument for 404 prevents page / site from displaying. Crafty free web host. :) – null Jul 24 '13 at 03:34
  • The edit above should work, but you'll need it on every page that needs the increased upload size. – David Jul 25 '13 at 01:07