PHP上传限制和后限制的上限

时间:2021-03-12 14:56:13

I have changed my upload and post limit options to 8000 M. However, when I try to import a table from a text file that's only 12.4 MB I get an error saying:

我已将上传和发布限制选项更改为8000 M.但是,当我尝试从仅为12.4 MB的文本文件导入表时,我收到错误消息:

You probably tried to upload too large file. Please refer to documentation for ways to workaround this limit.

Is 8000 M to big?

8000米大吗?

4 个解决方案

#1


2  

Be careful not to exceed the 32 bit signed integer limit (if you're using 32bit versions) as it will cause your script to fail.

注意不要超过32位有符号整数限制(如果您使用的是32位版本),因为它会导致脚本失败。

http://www.php.net/manual/en/ini.core.php#ini.post-max-size

#2


0  

First make sure to check these values in php.ini

首先确保在php.ini中检查这些值

max_execution_time

max_input_time

memory_limit

I would also lower your post_max_size and upload_max_size to a more reasonable level (like maybe 128 or 256M)

我也会将你的post_max_size和upload_max_size降低到更合理的水平(比如128或256M)

Also if you really need to get the data in, you could do it from the command line

此外,如果您确实需要获取数据,可以从命令行执行此操作

mysql -u username -p database < dump.sql

#3


0  

copy and pasted below from: http://daipratt.co.uk/importing-large-files-into-mysql-with-phpmyadmin/

复制并粘贴在下面:http://daipratt.co.uk/importing-large-files-into-mysql-with-phpmyadmin/

It's how i overcome the exact same issue.

这就是我如何克服完全相同的问题。

When trying to import large SQL files into mysql using phpmyadmin, the phpmyadmin documentation offers a few solutions, but I find the easiest method to overcome this is…

当尝试使用phpmyadmin将大型SQL文件导入mysql时,phpmyadmin文档提供了一些解决方案,但我发现克服这个问题的最简单方法是......

Find the config.inc.php file located in the phpmyadmin directory. In my case it is located here: ? 1
C:\wamp\apps\phpmyadmin3.2.0.1\config.inc.php

找到位于phpmyadmin目录中的config.inc.php文件。就我而言,它位于这里:? 1 C:\ wamp \ apps \ phpmyadmin3.2.0.1 \ config.inc.php

Find the line with $cfg['UploadDir'] on it and update it to: ? 1
$cfg['UploadDir'] = 'upload';

找到包含$ cfg ['UploadDir']的行并将其更新为:? 1 $ cfg ['UploadDir'] ='上传';

Create a directory called ‘upload’ within the phpmyadmin directory. ? 1 C:\wamp\apps\phpmyadmin3.2.0.1\upload\

在phpmyadmin目录中创建一个名为“upload”的目录。 ? 1 C:\ wamp \ apps \ phpmyadmin3.2.0.1 \ upload \

Then place the large sql file that you are trying to import into the new upload directory. Now when you go onto the db import page within phpmyadmin console you will notice a drop down present that wasn’t there before – it contains all of the sql files in the upload directory that you have just created. You can now select this and begin the import.

然后将您尝试导入的大型sql文件放入新的上载目录中。现在,当您进入phpmyadmin控制台中的数据库导入页面时,您会注意到之前没有的下拉存在 - 它包含您刚刚创建的上载目录中的所有sql文件。您现在可以选择此项并开始导入。

If you’re not using WAMP on Windows, then I’m sure you’ll be able to adapt this to your environment without too much trouble.

如果您没有在Windows上使用WAMP,那么我相信您可以在不太麻烦的情况下将其适应您的环境。

#4


0  

I believe the problem is that you have exceeded the 3.2 GB limit (8,000 MB) imposed by a 32 bit process, with PHP. As such, you likely can not use the full 8,000 MB as you have specified. I have had PHP hang on code when processing close to 2000 MB as memory to use with a 32 bit PHP.

我相信问题是你已经超过了32位进程(使用PHP)强加的3.2 GB限制(8,000 MB)。因此,您可能无法使用指定的完整8,000 MB。当处理接近2000 MB的内存与32位PHP一起使用时,我已经将PHP挂在代码上。

#1


2  

Be careful not to exceed the 32 bit signed integer limit (if you're using 32bit versions) as it will cause your script to fail.

注意不要超过32位有符号整数限制(如果您使用的是32位版本),因为它会导致脚本失败。

http://www.php.net/manual/en/ini.core.php#ini.post-max-size

#2


0  

First make sure to check these values in php.ini

首先确保在php.ini中检查这些值

max_execution_time

max_input_time

memory_limit

I would also lower your post_max_size and upload_max_size to a more reasonable level (like maybe 128 or 256M)

我也会将你的post_max_size和upload_max_size降低到更合理的水平(比如128或256M)

Also if you really need to get the data in, you could do it from the command line

此外,如果您确实需要获取数据,可以从命令行执行此操作

mysql -u username -p database < dump.sql

#3


0  

copy and pasted below from: http://daipratt.co.uk/importing-large-files-into-mysql-with-phpmyadmin/

复制并粘贴在下面:http://daipratt.co.uk/importing-large-files-into-mysql-with-phpmyadmin/

It's how i overcome the exact same issue.

这就是我如何克服完全相同的问题。

When trying to import large SQL files into mysql using phpmyadmin, the phpmyadmin documentation offers a few solutions, but I find the easiest method to overcome this is…

当尝试使用phpmyadmin将大型SQL文件导入mysql时,phpmyadmin文档提供了一些解决方案,但我发现克服这个问题的最简单方法是......

Find the config.inc.php file located in the phpmyadmin directory. In my case it is located here: ? 1
C:\wamp\apps\phpmyadmin3.2.0.1\config.inc.php

找到位于phpmyadmin目录中的config.inc.php文件。就我而言,它位于这里:? 1 C:\ wamp \ apps \ phpmyadmin3.2.0.1 \ config.inc.php

Find the line with $cfg['UploadDir'] on it and update it to: ? 1
$cfg['UploadDir'] = 'upload';

找到包含$ cfg ['UploadDir']的行并将其更新为:? 1 $ cfg ['UploadDir'] ='上传';

Create a directory called ‘upload’ within the phpmyadmin directory. ? 1 C:\wamp\apps\phpmyadmin3.2.0.1\upload\

在phpmyadmin目录中创建一个名为“upload”的目录。 ? 1 C:\ wamp \ apps \ phpmyadmin3.2.0.1 \ upload \

Then place the large sql file that you are trying to import into the new upload directory. Now when you go onto the db import page within phpmyadmin console you will notice a drop down present that wasn’t there before – it contains all of the sql files in the upload directory that you have just created. You can now select this and begin the import.

然后将您尝试导入的大型sql文件放入新的上载目录中。现在,当您进入phpmyadmin控制台中的数据库导入页面时,您会注意到之前没有的下拉存在 - 它包含您刚刚创建的上载目录中的所有sql文件。您现在可以选择此项并开始导入。

If you’re not using WAMP on Windows, then I’m sure you’ll be able to adapt this to your environment without too much trouble.

如果您没有在Windows上使用WAMP,那么我相信您可以在不太麻烦的情况下将其适应您的环境。

#4


0  

I believe the problem is that you have exceeded the 3.2 GB limit (8,000 MB) imposed by a 32 bit process, with PHP. As such, you likely can not use the full 8,000 MB as you have specified. I have had PHP hang on code when processing close to 2000 MB as memory to use with a 32 bit PHP.

我相信问题是你已经超过了32位进程(使用PHP)强加的3.2 GB限制(8,000 MB)。因此,您可能无法使用指定的完整8,000 MB。当处理接近2000 MB的内存与32位PHP一起使用时,我已经将PHP挂在代码上。