简体   繁体   English

upload_max_filesize,php.ini和Google App Engine

[英]upload_max_filesize, php.ini, and Google App Engine

I have a PHP 5.5 application running on Google App Engine. 我在Google App Engine上运行了一个PHP 5.5应用程序。 It's based on the CodeIgniter framework. 它基于CodeIgniter框架。 Recently I started needing to upload files more than 8 MB. 最近我开始需要上传超过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. 我编辑了php.ini(与app.yaml位于同一目录中),但它似乎没有影响最大上传大小。

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

Is there somewhere else I should be setting the max_size? 还有其他地方我应该设置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): 我在我的.htaccess文件中使用它(这适用于您可能无法更改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 进一步:在Codeigniter中,您可以在config.php文件中设置filesize首选项:请参阅此处

The PHP runtime Directives documentation may be useful. PHP运行时指令文档可能很有用。 As you indicated, php.ini file should be in the same directory as your app.yaml. 如您所示, php.ini文件应与app.yaml位于同一目录中。 I'd sugest specifically looking at the file_uploads and max_file_uploads values. 我特意看看file_uploadsmax_file_uploads值。 (Note that the default for each is 0, try setting it to 1). (请注意,每个的默认值为0,尝试将其设置为1)。

I added below in php.ini (same place where app.yaml is located) it worked 我在php.ini(app.yaml所在的同一个地方)下面添加了它

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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