php PHPMyAdmin 中的导入文件大小限制

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3958615/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 11:34:26  来源:igfitidea点击:

Import file size limit in PHPMyAdmin

phpmysqlphpmyadmin

提问by ronaldosantana

I have changed all the php.ini parameters I know: upload_max_filesize, post_max_size.

我已经更改了我知道的所有 php.ini 参数: upload_max_filesize, post_max_size.

Why am I still seeing 2MB?

为什么我仍然看到 2MB?

Im using Zend Server CE, on a Ubuntu VirtualBox over a Windows 7 host.

我在 Windows 7 主机上的 Ubuntu VirtualBox 上使用 Zend Server CE。

采纳答案by NikiC

You probably didn't restart your server ;)

您可能没有重新启动服务器;)

Or you modified the wrong php.ini.

或者你修改错了php.ini

Or you actually managed to do both ^^

或者你实际上设法做到了这两点^^

回答by Aditya P Bhatt

Find the file called: php.inion your server and follow below steps

php.ini在您的服务器上找到名为:的文件,然后按照以下步骤操作

With apache2 and php5 installed you need to make three changes in the php.ini file. First open the file for editing, e.g.:

安装 apache2 和 php5 后,您需要在 php.ini 文件中进行三处更改。首先打开文件进行编辑,例如:

sudo gedit /etc/php5/apache2/php.ini

sudo gedit /etc/php5/apache2/php.ini

OR

或者

sudo gedit /etc/php/7.0/apache2/php.ini

sudo gedit /etc/php/7.0/apache2/php.ini

Next, search for the post_max_sizeentry, and enter a larger number than the size of your database (15M in this case), for example:

接下来,搜索post_max_size条目,并输入一个大于数据库大小(在本例中为 15M)的数字,例如:

post_max_size = 25M

Next edit the entry for memory_limitand give it a larger value than the one given to post_max_size.

接下来编辑条目memory_limit并赋予它一个比赋予的更大的值post_max_size

Then ensure the value of upload_max_filesizeis smaller than post_max_size.

然后确保 的值upload_max_filesize小于post_max_size

The order from biggest to smallest should be:

从大到小的顺序应该是:

    memory_limit
    post_max_size
    upload_max_filesize

After saving the file, restart apache (e.g. sudo /etc/init.d/apache2 restart) and you are set.

保存文件后,重新启动 apache(例如sudo /etc/init.d/apache2 restart)并设置。

Don't forget to Restart Apache Servicesfor changes to be applied.

不要忘记Restart Apache Services应用更改。

For further details, click here.

欲知更多详情,请点击此处

回答by ersks

Just change your php.ini(xampp/php/php.ini) file, it worked for me!

只需更改您的 php.ini(xampp/php/php.ini) 文件,它对我有用!

max_execution_time = 5000
max_input_time = 5000
memory_limit = 1000M
post_max_size = 750M
upload_max_filesize = 750M

And, don't forget to restart Apache Modulefrom XAMPP Control Panel.

并且,不要忘记从XAMPP Control Panel重新启动Apache Module

回答by Abu Fahim

Increase phpMyAdmin upload / import size

增加phpMyAdmin上传/导入大小

By default you get a 2mb limit of upload / import size in phpmyadmin. That makes it odd and highly impossible to import larger files. You can increase the allowed upload size of phpmyadmin by editing your server's php.ini configuration file. Usually in servers like CentOs it is located at /etc/php.ini.

默认情况下,您在 phpmyadmin 中的上传/导入大小限制为 2mb。这使得导入更大的文件变得奇怪且极不可能。您可以通过编辑服务器的 php.ini 配置文件来增加 phpmyadmin 的允许上传大小。通常在像 CentOs 这样的服务器中,它位于 /etc/php.ini。

Step 1: Go to php.ini and find the following and change their values to something more higher than your database size. (In this example i have used 20mb).

步骤 1:转到 php.ini 并找到以下内容并将它们的值更改为大于数据库大小的值。(在这个例子中,我使用了 20mb)。

upload_max_filesize = 20M

post_max_size = 20M

Step2 : Restart your apache service for this new change to take effect. Usually the command to restart apache would be

步骤 2 :重新启动您的 apache 服务以使此新更改生效。通常重启apache的命令是

service httpd restart (CentOs) / service apache2 restart (ubuntu)

You can also restart directly from their path like

您也可以直接从他们的路径重新启动,例如

/etc/init.d/apache2 restart or /etc/init.d/httpd restart

If you are in a shared hosting and do not have root access or access to your php.ini configuration file, then the other way is to create a .htaccess file in your application root and add the following line

如果您在共享主机中并且没有 root 访问权限或访问您的 php.ini 配置文件,那么另一种方法是在您的应用程序根目录中创建一个 .htaccess 文件并添加以下行

php_value upload_max_filesize 10M
php_value post_max_size 10M

If you were still not able to increase it, please send me an email for more detailed assistance.

如果您仍然无法增加它,请给我发送电子邮件以获得更详细的帮助。

回答by Abu Fahim

For uploading large files through PHPMyAdmin, follow these steps:

要通过 PHPMyAdmin 上传大文件,请按照下列步骤操作:

Step 1: Open your php.ini file.

第 1 步:打开您的 php.ini 文件。

Step 2: Upgrading Memory Limit:

第 2 步:升级内存限制:

memory_limit = 750M

Step 3: Upgrading Maximum size to post:

第 3 步:升级要发布的最大尺寸:

post_max_size = 750M

post_max_size = 750M

Step 4: Upgrading Maximum file-size to upload:

第 4 步:升级要上传的最大文件大小:

upload_max_filesize = 1000M

upload_max_filesize = 1000M

Step 5: Upgrading Maximum Execution Time:

第 5 步:升级最大执行时间:

max_execution_time = 5000

max_execution_time = 5000

Step 6: Upgrading Maximum Input Time:

第 6 步:升级最大输入时间:

max_input_time = 3000

max_input_time = 3000

Step 7: Restart your xampp control panel.

第 7 步:重新启动 xampp 控制面板。

回答by Lukas Liesis

Check your all 3:

检查所有 3 项:

  • upload_max_filesize
  • memory_limit
  • post_max_size
  • 上传最大文件大小
  • 内存限制
  • post_max_size

in the php.ini configuration file

在 php.ini 配置文件中

* for those, who are using wamp @windows, you can follow these steps: *

* 对于使用 wamp @windows 的用户,您可以按照以下步骤操作:*

Also it can be adapted to any phpmyadmin installation.

它也可以适应任何 phpmyadmin 安装。

Find your config.inc.php file for PhpMyAdmin configuration (for wamp it's here: C:\wamp\apps\phpmyadminVERSION\config.inc.php

找到用于 PhpMyAdmin 配置的 config.inc.php 文件(对于 wamp,它在这里:C:\wamp\apps\phpmyadminVERSION\config.inc.php

add this line at the end of the file BEFORE "?>":

在文件末尾“?>”之前添加这一行:

$cfg['UploadDir'] = 'C:\wamp\sql';

save

节省

create folder at

创建文件夹在

C:\wamp\sql 

copy your huge sql file there.

在那里复制你巨大的 sql 文件。

Restart server.

重启服务器。

Go to your phpmyadmin import tab and you'll see a list of files uploaded to c:\wamp\sql folder.

转到您的 phpmyadmin 导入选项卡,您将看到上传到 c:\wamp\sql 文件夹的文件列表。

回答by Karan Datwani

enter image description here

在此处输入图片说明

Open this file

打开这个文件

edit these parameters:

编辑这些参数:

  • memory_limit =128M
  • post_max_size = 64M
  • upload_max_filesize = 64M
  • 内存限制=128M
  • post_max_size = 64M
  • upload_max_filesize = 64M

回答by Shashank Saxena

This is how i did it:

我是这样做的:

  1. Locate in the /etc/php5/apache2/php.ini

    post_max_size = 8M
    upload_max_filesize = 2M
    
  2. Edit it as

    post_max_size = 48M
    upload_max_filesize = 42M
    
  1. 位于 /etc/php5/apache2/php.ini

    post_max_size = 8M
    upload_max_filesize = 2M
    
  2. 将其编辑为

    post_max_size = 48M
    upload_max_filesize = 42M
    

(Which is more then enough)

(这就够了)

Restarted the apache:

重启apache:

sudo /etc/init.d/apache2 restart

回答by gael

With WAMP, on Windows10, open

使用 WAMP,在 Windows10 上,打开

c:\wamp64\alias\phpmyadmin.conf

and change 128 by 256 at the end of these lines

并在这些行的末尾将 128 更改为 256

  php_admin_value upload_max_filesize 128M
  php_admin_value post_max_size 128M

Restart WAMP

重启 WAMP

回答by Ben Wilde

None of the current answers will work for WHM / cPanel servers.

当前的答案都不适用于 WHM / cPanel 服务器。

To increase the limit in WHM:

要增加 WHM 的限制:

  1. Navigate to Server Configuration > Tweak Settings
  2. Choose the PHP tab
  3. Update "cPanel PHP max POST size" & "cPanel PHP max upload size" (POST size should be bigger)
  1. 导航到服务器配置 > 调整设置
  2. 选择 PHP 选项卡
  3. 更新“cPanel PHP 最大 POST 大小”和“cPanel PHP 最大上传大小”(POST 大小应该更大)