php PHPMyAdmin最大上传大小不会改变,错误的php.ini文件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14380205/
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
PHPMyAdmin max upload size will not change, wrong php.ini file
提问by imperium2335
I have recently reinstalled my server this time with WAMP, previously I was using XAMPP.
这次我最近用 WAMP 重新安装了我的服务器,以前我使用的是 XAMPP。
In phpmyadmin the max upload size for database files is at 2,048kb.
在 phpmyadmin 中,数据库文件的最大上传大小为 2,048kb。
I have changed the three variables in php.ini according to several forums and articles on the problem, restarted my server and it has no effect what so ever.
我根据几个论坛和关于该问题的文章更改了php.ini中的三个变量,重新启动了我的服务器,它没有任何影响。
Is there some kind of environmental path variable etc that needs setting elsewhere?
是否有某种环境路径变量等需要在其他地方设置?
What am I missing.
我错过了什么。
采纳答案by Peter Wooster
The php.ini may not be the one you expect. Be sure to check phpinfo to see what config is being used and which parameters are active.
php.ini 可能不是您所期望的。请务必检查 phpinfo 以查看正在使用的配置以及哪些参数处于活动状态。
回答by Vlad Preda
Put these in php.ini
将这些放在 php.ini 中
upload_max_filesize = 10M
post_max_size = 10M
Or you can put these in .htaccess:
或者你可以把这些放在 .htaccess 中:
php_value upload_max_filesize 10M
php_value post_max_size 10M
Replace 10M with anything you want.
用你想要的任何东西替换 10M。
Extra:To find what php.ini is currently used, create a file in the web root, let's say info.phpthat contains <?php phpinfo();. Then access that file from your browser, and search for php.ini. This has to be done through the browser, from the command line you will see the php.iniused in cli.
额外:要查找当前使用的 php.ini,请在 Web 根目录中创建一个文件,假设info.php包含<?php phpinfo();. 然后从浏览器访问该文件,并搜索php.ini. 这必须通过浏览器完成,从命令行你会看到php.inicli 中使用的。
When finished, restart Apache for the changes to take effect.
完成后,重新启动 Apache 以使更改生效。
回答by Ankit Shrivastava
First you have to change values in php.inifile as per your requirements.
首先,您必须根据您的要求更改php.ini文件中的值。
post_max_size = 1024M
upload_max_filesize = 1024M
max_execution_time = 3600
max_input_time = 3600
memory_limit = 1024M
Note - Change these values carefully. These values will impact for all of your projects of that server.
注 - 仔细更改这些值。这些值将影响该服务器的所有项目。
Now, If all above solutions are not working, kindly check your phpmyadmin.conffile. If you are using WAMP so you can find the file in "C:\wamp64\alias".
现在,如果以上所有解决方案都不起作用,请检查您的phpmyadmin.conf文件。如果您使用的是 WAMP,那么您可以在"C:\wamp64\alias" 中找到该文件。
You have to change below values.
您必须更改以下值。
Values already in file are -
文件中已有的值是 -
php_admin_value upload_max_filesize 128M
php_admin_value post_max_size 128M
php_admin_value max_execution_time 360
php_admin_value max_input_time 360
Change above code to -
将上面的代码更改为 -
# php_admin_value upload_max_filesize 128M
# php_admin_value post_max_size 128M
# php_admin_value max_execution_time 360
# php_admin_value max_input_time 360
Now just restart your server, to work with changed values. :)
现在只需重新启动您的服务器,即可使用更改后的值。:)
回答by Cristiana Chavez
We need to increase the maximum file size value in php.inifile, By default, the upload_max_filesize is set to 2MBin XAMPP
我们需要增加php.ini文件中的最大文件大小值,默认情况下,XAMPP中upload_max_filesize设置为2MB
To resolve this problem:
要解决此问题:
We need to locate where the php.ini file is. in Xampp, it is found in C:\xampp\php.
Open the php.inifile, search for “upload_max_filesize” and replace the 2M (meaning 2-Megabyte) to a higher value, say 50M.
我们需要找到 php.ini 文件所在的位置。在 Xampp 中,它位于C:\xampp\php 中。
打开php.ini文件,搜索“upload_max_filesize”并将 2M(意思是 2-Megabyte)替换为更高的值,比如 50M。
change: upload_max_filesize =2M
改变:upload_max_filesize =2M
to: upload_max_filesize =50M
到:upload_max_filesize =50M
- Restart Apache for the change to take effect.
- 重新启动 Apache 以使更改生效。
回答by stardust4891
This drove me insane but I found that WAMPServer has a file in alias/phpmyadmin.confthat I needed to make the changes in.
这让我发疯了,但我发现 WAMPServer 有一个文件alias/phpmyadmin.conf,我需要在其中进行更改。
回答by Ga?tan Trema
Another lead : If you use PHP FPM, you need to restart the fpm service after setting values in php.ini. On debian based systems :
另外一个提示:如果使用PHP FPM,需要在php.ini中设置好值后重启fpm服务。在基于 debian 的系统上:
service php7.3-fpm restart
service php7.3-fpm restart

