php - Symfony 3、Php 和 Ubuntu 16 无法上传大文件

标签 php symfony ubuntu

我被卡住了,我无法弄清楚为什么 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/

相关文章:

php - 使 MySQL 字段中的 NULL 值显示为 0/N/A

php - Eloquent 外部 Laravel 将获取模式更改为 PDO::FETCH_ASSOC

php - Laravel 默认 orderBy

ubuntu - wxWidgets安装后找不到wxWebView

ubuntu - 使用 apt-get 更改 Ubuntu 安装上的默认 JENKINS_HOME 目录?

php - 不确定 .htaccess 文件是否正确。还有一些来自 mySQL 的 fetch 问题

php - Symfony httplug 包句柄缺少 EventSubscriberInterface

authentication - Symfony2 : login does not work on first try after clearing cookies

Symfony2 作业队列或并行处理?

ubuntu -/bin/sh : 1: apk: not found while creating docker image