我被卡住了,我无法弄清楚为什么 Ubuntu 和 PHP (Symfony3) 不允许上传大于 2Mb 的文件。我已更改所有 php.ini 设置并重新启动 apache,但问题仍然存在。这是我在 php.ini 中的设置
当我从命令行运行 php -i 时,我有以下输出:
Loaded Configuration File => /etc/php/7.1/cli/php.ini (this is the .ini file I have edited)
file_uploads => On => On
max_execution_time => 0 => 0 (in my php.ini i have max_execution_time = 300 - not sure why this says 0)
max_file_uploads => 20 => 20
max_input_nesting_level => 64 => 64
max_input_time => -1 => -1
max_input_vars => 1000 => 1000
memory_limit => -1 => -1
post_max_size => 64M => 64M
upload_max_filesize => 64M => 64M
有什么想法吗?
最佳答案
您当前正在更改 CLI(通过命令行执行 PHP)的 php.ini,这不会通过 Apache 影响 PHP。您需要在以下位置更改 Apache 的 php.ini:
/etc/php/7.1/apache2/php.ini
更改该 ini 文件并重新启动 Apache,您应该一切顺利。
关于php - Symfony 3、Php 和 Ubuntu 16 无法上传大文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46243381/