Import file size limit in PHPMyAdmin

后端 未结 27 2463
遇见更好的自我
遇见更好的自我 2020-11-27 08:46

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

Why am I still seeing 2MB?

Im using Zend Serv

相关标签:
27条回答
  • 2020-11-27 09:27

    I had the same problem, My upload limit was 2 MB, I edited my php.ini, and I set it to 5 MB but still it was showing 2 MB even after restarting server. Than I compressed my .sql file to zip by keeping its name as xyz.sql.zip so it became 451 kb from 3.5 mb. Then I uploaded it again. It worked for me.

    0 讨论(0)
  • 2020-11-27 09:29

    For uploading large files through PHPMyAdmin, follow these steps:

    Step 1: Open your php.ini file.

    Step 2: Upgrading Memory Limit:

    memory_limit = 750M
    

    Step 3: Upgrading Maximum size to post:

    post_max_size = 750M

    Step 4: Upgrading Maximum file-size to upload:

    upload_max_filesize = 1000M

    Step 5: Upgrading Maximum Execution Time:

    max_execution_time = 5000

    Step 6: Upgrading Maximum Input Time:

    max_input_time = 3000

    Step 7: Restart your xampp control panel.

    0 讨论(0)
  • 2020-11-27 09:29

    I had a problem with changing the upload size on my phpmyadmin and OS X 10.9.4 Mavericks. At first I didn't know where the php.ini is so used locate

    locate php.ini
    

    which came back with

    /private/etc/php.ini.default
    /usr/local/etc/php/5.4/php.ini
    

    I've tried editing /usr/local/etc/php/5.4/php.ini and then restart in the server put this didn't work.

    I remembered that there is a better way to find out this file I'm looking for or and least where php is looking for php.ini.

    <?php phpinfo() ?>
    

    came back saying that it expects /etc/php.ini but I didn't have one there. The below is from the phpinfo():

    Configuration File (php.ini) Path: /etc
    

    It turns out that the first result in the locate command above is what I'm looking for.

    At least in OS X 10.9.4 Mavericks (OS X is something new to me) /etc is actually a link, etc -> private/etc, and by the looks of it PHP assumes default values unless php.ini is actually present.

    I copied /private/etc/php.ini.default

    cp /private/etc/php.ini.default /private/etc/php.ini
    

    Then checked the variables in the new /etc/php.ini as per Aditya Bhatt advice above and it worked. In my case the values were:

    memory_limit =128M
    post_max_size = 64M
    upload_max_filesize = 64M
    

    Obviously, the apache service has to be restarted to see the changes.

    0 讨论(0)
  • 2020-11-27 09:29

    I was facing the same problem where increasing max size in php.ini has no effect on wordpress and tried many solutions like -:

    1. Increase max size via functions.php
    2. Increase max size via .htaccess file.

    The one that worked for me is adding max size in .htaccess file. It wasn't working with neither with php.ini file nor with functions.php file.

    I just did add this code in .htaccess file and its done

    php_value upload_max_filesize 64M
    php_value post_max_size 64M
    php_value max_execution_time 300
    php_value max_input_time 300
    

    NOTE: I did add above code in <IfModule> tag.

    If php.ini file is not doing anything in changing size then try other 2 files for it and one of them will surely work for you.

    READ THIS ARTICLE TO KNOW ABOUT ALL FILES IN WHICH YOU CAN INCREASE MAX SIZE

    0 讨论(0)
  • 2020-11-27 09:32

    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
      

    (Which is more then enough)

    Restarted the apache:

    sudo /etc/init.d/apache2 restart
    
    0 讨论(0)
  • 2020-11-27 09:32

    Note: (added July 2020)

    I'm surprised nobody else has mentioned this ... changing php.ini should probably be your last resort when increasing file upload sizes to something as big as 64MB.

    It may not matter greatly on development machines, but editing php.ini to globally increase max upload size could be a really bad idea on a server where you have several websites operating. MySQL imports to PHPMyAdmin are often large, but you don't want every Tom, Dick and Mary uploading 64MB files to another site on your server because you need to do it every now and again for your MySQL database.

    I'd suggest a better solution is therefore (assuming you are using the standard Apache PHP module) to edit the specific virtual host configuration for PHPMyAdmin.

    On Ubuntu Linux, this is found in /etc/apache2/conf-enabled/ phpmyadmin.conf. On WAMP/Windows/Whatever you'll need to look at the setup for your Apache configuration, but it will probably be in conf-enabled, conf.d, sites-enabled, or something like that. These are actually often just symlinks to the actual file which is located somewhere like /etc/phpmyadmin/apache.conf (again using Ubuntu as the example here).

    Your apache.conf file will include lines something like this:

    Alias /phpmyadmin /usr/share/phpmyadmin
    
    <Directory /usr/share/phpmyadmin>
        Options SymLinksIfOwnerMatch
        DirectoryIndex index.php
    
        # limit libapache2-mod-php to files and directories necessary by pma
        <IfModule mod_php7.c> 
            php_admin_value upload_tmp_dir /var/lib/phpmyadmin/tmp
            php_admin_value open_basedir /usr/share/phpmyadmin/:/etc/phpmyadmin/:/var/lib/phpmyadmin/:/usr/share/php/php-gettext/:/usr/share/php/php-php-gettext/:/usr/share/javascript/:/usr/share/php/tcpdf/:/usr/share/doc/phpmyadmin/:/usr/share/php/phpseclib/:/usr/share/php/PhpMyAdmin/:/usr/share/php/Symfony/:/usr/share/php/Twig/:/usr/share/php/Twig-Extensions/:/usr/share/php/ReCaptcha/:/usr/share/php/Psr/Container/:/usr/share/php/Psr/Cache/:/usr/share/php/Psr/Log/:/usr/share/php/Psr/SimpleCache/
        </IfModule>
    
    </Directory>
    

    Immediately after <IfModule mod_php7.c> add these lines:

        php_value post_max_size 64M
        php_value upload_max_filesize 64M
    

    Depending on your server config, you can probably achieve the same thing in an .htaccess file if you prefer. In which case you could just add the two lines by themselves (assuming you know for certain that PHP is enabled).

    If you use fpm or fastcgi or something with or without Apache, the same more localized approach to controlling upload sizes can be achieved by using .user.ini files.

    0 讨论(0)
提交回复
热议问题