How to break through the php file size limit

Source: Internet
Author: User
How to break through the php file size limit
This section describes how to break through the php file size limit, including php file upload and phpmyadmin configuration methods. For more information, see.

When phpmyadmin imports an SQL file, the size of the file to be uploaded is limited. the default size of the phpmyadmin file to be uploaded is 2 MB. if you want phpmyadmin to upload a file larger than 2 MB, you need to modify the phpmyadmin file size configuration or batch upload large files. it is much easier to modify the phpmyadmin file size limit.

To solve the problem of phpmyadmin file size restrictions, you need to modify the php. ini configuration file and phpmyadmin configuration file.

Step 1: modify php. configure the file upload size in the ini configuration file. INI configuration file upload functions are the same, you need to modify php. the upload_max_filesize and post_max_size options in the ini configuration file. for details about how to modify them, see PHP. INI configuration: File Upload Configuration tutorial.

Step 2: modify the php execution time and memory limit to implement the phpmyadmin function to upload large files. if you want phpmyadmin to upload large files, 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 the $ cfg ['exectimelimmit '] configuration option in the phpmyadmin \ config. inc. php configuration file. the default value is 300. you need to change it to 0, that is, there is no time limit. 2. modify $ memory_limit on the import page under the phpmyadmin installation root directory. note: The MemoryLimit configuration comes from phpmyadmin \ config. inc. php. the default value is 0.

Description: php is preferred. the memory configuration option memory_limit in The ini configuration file. if it is null, the default memory size limit is 2 MB. if there is no limit, the memory size limit is 10 MB. 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.

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.