简体   繁体   中英

Increase file upload size but cannot locate/access php.ini

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?

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 ).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM