• <legend id='FMaDQ'><style id='FMaDQ'><dir id='FMaDQ'><q id='FMaDQ'></q></dir></style></legend>

    <small id='FMaDQ'></small><noframes id='FMaDQ'>

    • <bdo id='FMaDQ'></bdo><ul id='FMaDQ'></ul>
      <i id='FMaDQ'><tr id='FMaDQ'><dt id='FMaDQ'><q id='FMaDQ'><span id='FMaDQ'><b id='FMaDQ'><form id='FMaDQ'><ins id='FMaDQ'></ins><ul id='FMaDQ'></ul><sub id='FMaDQ'></sub></form><legend id='FMaDQ'></legend><bdo id='FMaDQ'><pre id='FMaDQ'><center id='FMaDQ'></center></pre></bdo></b><th id='FMaDQ'></th></span></q></dt></tr></i><div id='FMaDQ'><tfoot id='FMaDQ'></tfoot><dl id='FMaDQ'><fieldset id='FMaDQ'></fieldset></dl></div>
      1. <tfoot id='FMaDQ'></tfoot>

        覆盖 upload_max_filesize

        overriding upload_max_filesize(覆盖 upload_max_filesize)

          • <bdo id='2owSp'></bdo><ul id='2owSp'></ul>
              <tbody id='2owSp'></tbody>
            1. <legend id='2owSp'><style id='2owSp'><dir id='2owSp'><q id='2owSp'></q></dir></style></legend>

                <i id='2owSp'><tr id='2owSp'><dt id='2owSp'><q id='2owSp'><span id='2owSp'><b id='2owSp'><form id='2owSp'><ins id='2owSp'></ins><ul id='2owSp'></ul><sub id='2owSp'></sub></form><legend id='2owSp'></legend><bdo id='2owSp'><pre id='2owSp'><center id='2owSp'></center></pre></bdo></b><th id='2owSp'></th></span></q></dt></tr></i><div id='2owSp'><tfoot id='2owSp'></tfoot><dl id='2owSp'><fieldset id='2owSp'></fieldset></dl></div>
                <tfoot id='2owSp'></tfoot>
                • <small id='2owSp'></small><noframes id='2owSp'>

                  本文介绍了覆盖 upload_max_filesize的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我试图在 php 中覆盖我的 upload_max_filesize 但我仍然得到我的 php.ini 文件中的值,即 2 mb.

                  I am trying to override my upload_max_filesize in php but I still get the value which is in my php.ini file which is 2 mb.

                  ini_set('upload_max_filesize','30M');
                  ini_set('post_max_size','30M');
                  echo("<br>".ini_get('upload_max_filesize')."<br>");
                  

                  推荐答案

                  这些设置在通过 ini_set 设置时不会有任何影响.

                  Those settings are not going to have any effect when set via ini_set.

                  原因是 PHP 需要这些值之前你的脚本甚至被执行.当发生上传时,目标脚本会在上传完成后执行,因此 PHP 需要事先知道最大大小.

                  The reason is that PHP needs those values before your script is even executed. When an upload occurs, the target script is executed when the upload is complete, so PHP needs to know the maximum sizes beforehand.

                  将它们设置在 php.ini、您的虚拟主机配置或 .htaccess 文件中.典型的 .htaccess 文件如下所示:

                  Set them in php.ini, your virtual host config, or in a .htaccess file. A typical .htaccess file would look like this:

                  php_value post_max_size 30M
                  php_value upload_max_filesize 30M
                  

                  这篇关于覆盖 upload_max_filesize的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  PHP Upload File Validation(PHP 上传文件验证)
                  PHP Error - Uploading a file(PHP 错误 - 上传文件)
                  How can I write tests for file upload in PHP?(如何在 PHP 中编写文件上传测试?)
                  php resizing image on upload rotates the image when i don#39;t want it to(php在上传时调整图像大小会在我不想要它时旋转图像)
                  How to send additional data using PLupload?(如何使用 PLupload 发送附加数据?)
                  change button text in js/ajax after mp4 =gt;mp3 conversion in php(在 php 中的 mp4 =gt;mp3 转换后更改 js/ajax 中的按钮文本)

                    <tbody id='pb4z7'></tbody>
                    • <bdo id='pb4z7'></bdo><ul id='pb4z7'></ul>

                        <small id='pb4z7'></small><noframes id='pb4z7'>

                        <tfoot id='pb4z7'></tfoot>
                            <i id='pb4z7'><tr id='pb4z7'><dt id='pb4z7'><q id='pb4z7'><span id='pb4z7'><b id='pb4z7'><form id='pb4z7'><ins id='pb4z7'></ins><ul id='pb4z7'></ul><sub id='pb4z7'></sub></form><legend id='pb4z7'></legend><bdo id='pb4z7'><pre id='pb4z7'><center id='pb4z7'></center></pre></bdo></b><th id='pb4z7'></th></span></q></dt></tr></i><div id='pb4z7'><tfoot id='pb4z7'></tfoot><dl id='pb4z7'><fieldset id='pb4z7'></fieldset></dl></div>
                            <legend id='pb4z7'><style id='pb4z7'><dir id='pb4z7'><q id='pb4z7'></q></dir></style></legend>