How to configure phpmyadmin file size limit

Source: Internet
Author: User
When phpmyadmin imports an SQL file, The phpmyadmin file size limit is involved. the default phpmyadmin file size is 2 MB. if you want phpmyadmin to import an SQL file, The phpmyadmin file size limit is involved, by default, the size of the phpmyadmin file to be uploaded is 2 MB. if you want phpmyadmin to upload files larger than 2 MB, you need to modify the size configuration of the phpmyadmin file to be uploaded or upload large files in batches, it is much easier to modify the size limit of the phpmyadmin file to be uploaded. To solve the problem of phpmyadmin file size restrictions, modify the php. ini configuration file and phpmyadmin configuration file.

Modify the phpmyadmin file size limit by modifying the php. ini configuration file and phpmyadmin configuration file.

  Step 1: modify the file upload size configuration in the php. ini configuration file

This step is consistent with the general PHP. INI configuration file upload function, you need to modify the php. ini configuration fileUpload_max_filesizeAndPost_max_sizeThe options are as follows: PHP. INI configuration: File Upload Configuration tutorial.

  Step 2: modify the php execution time and memory limit to enable phpmyadmin to upload large files

If you want phpmyadmin to upload large files, you also need to modify php. in the ini configuration file, max_execution_time (maximum time for executing php pages), max_input_time (maximum time for receiving data from php pages), and memory_limit (maximum memory occupied by php pages) are three configuration options, this is because when phpmyadmin uploads a large file, the execution time and memory usage of the php page will inevitably become larger. it requires the cooperation of the php runtime environment and it is not enough to modify the size limit of the uploaded file.

  Step 3: modify the phpmyadmin configuration file

After completing the related configuration of php. ini, you also need to modify the phpmyadmin configuration.

1. modify$ Cfg ['exectimelimit ']Configuration option. the default value is 300. you need to change it to 0, that is, there is no time limit.

2. modify the import page in The phpmyadmin installation root directory$ Memory_limit

1
2
3
4
5
6
7
8
9
$ Memory_limit = trim (@ ini_get ('memory _ limit '));
// 2 MB as default
If (empty ($ memory_limit )){
$ Memory_limit = 2x1024*1024;
}
// In case no memory limit we work on 10 MB chunks
If ($ memory_limit =-1 ){
$ Memory_limit = 10*1024*1024;
}

Description: Php is preferred. the memory configuration option memory_limit in The ini configuration file. if it is null, the default memory size is limited to 2 MB. if there is no limit, the memory size is limited to 10 MB. you can combine your php. modify the code in the ini configuration file.

So far, after modifying the file upload configuration options in the php. ini configuration file and The phpmyadmin configuration file, you can solve the file size limit problem of phpmyadmin, so as to implement the function of uploading large files by phpmyadmin.

  Note: PHP website development tutorial -leapsoul.cn All rights reserved. please indicate the original source and this statement in the form of a link during reprinting. thank you.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.