简体   繁体   English

PHPMyAdmin最大上传大小不会更改,错误的php.ini文件

[英]PHPMyAdmin max upload size will not change, wrong php.ini file

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. 我想念什么。

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.php that contains <?php phpinfo(); 补充:要查找当前使用的php.ini,请在网络根目录中创建一个文件,假设info.php包含<?php phpinfo(); . Then access that file from your browser, and search for php.ini . 然后从浏览器访问该文件,并搜索php.ini This has to be done through the browser, from the command line you will see the php.ini used in cli. 这必须通过浏览器完成,在命令行中,您将看到cli中使用的php.ini

When finished, restart Apache for the changes to take effect. 完成后,重新启动Apache以使更改生效。

First you have to change values in php.ini file 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.conf file. 现在,如果以上所有解决方案均无效,请检查您的phpmyadmin.conf文件。 If you are using WAMP so you can find the file in "C:\\wamp64\\alias" . 如果使用的是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. 现在只需重新启动服务器,即可使用更改后的值。 :) :)

The php.ini may not be the one you expect. php.ini可能不是您所期望的。 Be sure to check phpinfo to see what config is being used and which parameters are active. 一定要检查phpinfo以查看正在使用的配置和激活的参数。

We need to increase the maximum file size value in php.ini file, By default, the upload_max_filesize is set to 2MB in XAMPP 我们需要增加php.ini文件中的最大文件大小值,默认情况下,在XAMPP中将upload_max_filesize设置为2MB

To resolve this problem: 解决此问题的方法:

  • We need to locate where the php.ini file is. 我们需要找到php.ini文件所在的位置。 in Xampp, it is found in C:\\xampp\\php . 在Xampp中,可以在C:\\ xampp \\ php中找到它。

  • Open the php.ini file, search for “upload_max_filesize” and replace the 2M (meaning 2-Megabyte) to a higher value, say 50M. 打开php.ini文件,搜索“ upload_max_filesize”,然后将2M(表示2 MB)替换为更高的值,例如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,以使更改生效。

这让我发疯,但是我发现WAMPServer在alias/phpmyadmin.conf中有一个文件,需要进行更改。

Another lead : If you use PHP FPM, you need to restart the fpm service after setting values in php.ini. 另一个线索:如果使用PHP FPM,则需要在php.ini中设置值后重新启动fpm服务。 On debian based systems : 在基于debian的系统上:

service php7.3-fpm restart

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM