ini_set("upload_max_filesize","200M") 在 php 中不起作用 [英] ini_set("upload_max_filesize","200M") not working in php

查看:31
本文介绍了ini_set("upload_max_filesize","200M") 在 php 中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<块引用>

可能的重复:
覆盖upload_max_filesize

我使用这些代码来更改上传文件大小:-

echo ini_get('upload_max_filesize').'
';ini_set("upload_max_filesize","300M");echo ini_get("upload_max_filesize");

但是我得到了

2M2M

在 php.ini 中设置.

我想更改文件上传大小限制.

解决方案

  1. http://php.net/manual/en/ini.list.php

<块引用>

upload_max_filesize "2M" PHP_INI_PERDIR

  1. http://php.net/manual/en/configuration.changes.modes.php

<块引用>

PHP_INI_PERDIR 可以在 php.ini、.htaccess、httpd.conf 或 .user.ini 中设置条目(自 PHP 5.3 起)

因此您不能为此使用 ini_set.

Possible Duplicate:
overriding upload_max_filesize

i use these code for change upload file size :-

echo ini_get('upload_max_filesize').'<br/>';
ini_set("upload_max_filesize","300M");
echo ini_get("upload_max_filesize");

BUT I GOT

2M
2M

which is set in php.ini.

i want to change file upload size limit.

解决方案

  1. http://php.net/manual/en/ini.list.php

upload_max_filesize "2M" PHP_INI_PERDIR

  1. http://php.net/manual/en/configuration.changes.modes.php

PHP_INI_PERDIR Entry can be set in php.ini, .htaccess, httpd.conf or .user.ini (since PHP 5.3)

So you can't use ini_set for this.

这篇关于ini_set("upload_max_filesize","200M") 在 php 中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆