简体   繁体   中英

upload_max_filesize, php.ini, and Google App Engine

I have a PHP 5.5 application running on Google App Engine. It's based on the CodeIgniter framework. Recently I started needing to upload files more than 8 MB.

I have been getting the following error

PHP Warning:  POST Content-Length of 8501809 bytes exceeds the limit of 8388608 bytes in Unknown on line 0 

I edited php.ini (which is in the same directory as app.yaml), but it doesn't seem to impact the maximum upload size.

post_max_size = "16M"
upload_max_filesize = "16M"
memory_limit = "128M"

Is there somewhere else I should be setting the max_size? Any other fields?

Thanks!

I'm using this in my .htaccess file (this works well on shared hosting where you might not be able to change php.ini):

## I need more memory to upload large image
<IfModule mod_php5.c>
  php_value memory_limit 256M
  php_value post_max_size 50M
  php_value upload_max_filesize 50M
</IfModule>

further: in Codeigniter you can set filesize preference in your config.php file: see here

The PHP runtime Directives documentation may be useful. As you indicated, php.ini file should be in the same directory as your app.yaml. I'd sugest specifically looking at the file_uploads and max_file_uploads values. (Note that the default for each is 0, try setting it to 1).

I added below in php.ini (same place where app.yaml is located) it worked

post_max_size = &quot;16M&quot;
upload_max_filesize = &quot;16M&quot;
memory_limit = &quot;128M&quot;

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