English 中文(简体)
PHP上的有效载荷不是运行的;档案尺寸似乎是问题,但上载量——最大程度——档案和员额——最大程度——是适当确定的。
原标题:PHP upload not working; file size appears to be the issue, but upload_max_filesize and post_max_size are set appropriately
  • 时间:2024-05-13 21:19:40
  •  标签:
  • php

NOTE: I m a novice with PHP.

我的PHP密码上载了小的档案,但 silent然没有用大约11M的测试文档。 因此,我发现了一些相关问题,例如,即,以及从

否则就没有!

我停止了阿帕奇并重新开始试验,在测试时重载了客户部分,但它依然没有工作。

如果你想看到该守则,这只是购买力平价的一部分...... MAYBE这一阿帕奇组合的其他一些方面正在回头申请?

To wit:

<?php

if ($_SERVER[ REQUEST_METHOD ] ===  POST ) {
    if (isset($_FILES[ files ])) {
        $errors = [];
        $path =  uploads/ ;
        $extensions = [ jpg ,  jpeg ,  png ,  gif ,  txt ,  mpeg ];
        
        $all_files = count($_FILES[ files ][ tmp_name ]);
        
        for ($i = 0; $i < $all_files; $i++) {
            $file_name = $_FILES[ files ][ name ][$i];
            $file_tmp = $_FILES[ files ][ tmp_name ][$i];
            $file_type = $_FILES[ files ][ type ][$i];
            $file_size = $_FILES[ files ][ size ][$i];
            $file_ext = strtolower(end(explode( . , $_FILES[ files ][ name ][$i])));            
            $file = $path . $file_name;                
            move_uploaded_file($file_tmp, $file);
        }

        if ($errors) print_r($errors);
    }
}

还有一个问题是,我不会发现任何错误产出,但也许我不认为印刷版的代码会寄出什么? 我愿意在“网页上”的客户-方浏览器窗口上展示。

www.un.org/spanish/ecosoc MAJOR ISSUE

利用S.C.info( )表明,NOT为I m的改动提供了荣誉吗?

我证明了这一点:Im 编辑了SonLY php.ini 案卷,在该系统上,这从phpinfo(以下)数据中得到确认,当我稍作改动时,NOT荣誉!

YES, I ve 每一次重新启用阿帕奇。

作为逐点,我把上载量从2M改为仅8M,但从Candreinfo()的数据确实没有变化。

请注意,我刚刚在火f灯浏览器上重载,以获取新数据,这能否打上旧数据?

Presuming not, this must be a platform issue?!

平台数据:

PHP Version 8.2.6
System  Linux server1 6.2.9-300.fc38.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Mar 30 22:32:58 UTC 2023 x86_64
Build Date  May 9 2023 06:25:31
Build System    Fedora release 38 (Thirty Eight)
Build Provider  Fedora Project
Compiler    gcc (GCC) 13.1.1 20230426 (Red Hat 13.1.1-1)
Architecture    x86_64
Server API  FPM/FastCGI
Virtual Directory Support   disabled
Configuration File (php.ini) Path   /etc
Loaded Configuration File   /etc/php.ini
Scan this dir for additional .ini files     /etc/php.d 

现有数据大为增加:如果任何人能够提出我应该做什么,我就会!

问题回答

Do you have a request with the content-type "application/x-www-form-urlencoded" header ? post_max_size set to 0 does not work with some content-type headers. https://www.php.net/manual/en/ini.core.php#ini.post-max-size

Try to specify a value for post_max_size that is at least equal to upload_max_filesize. For example:

post_max_size=128M
upload_max_filesize=128M

注:记忆-界限也必须至少等于这两个参数。





相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签