-
When phpmyadmin imports SQL files, it involves the size limit of the file uploaded by phpmyadmin. The default file size uploaded by phpmyadmin is 2M. If you want phpmyadmin to upload large files exceeding 2M, you need to modify the size configuration of the file uploaded by phpmyadmin or upload the large file in several batches. Relatively speaking, it is much more convenient to modify the size limit of uploaded files by phpmyadmin. Solving the problem of phpmyadmin upload file size limit involves modifying the php.ini configuration file and phpmyadmin configuration file.
Modifying the size limit of uploaded files by phpmyadmin mainly consists of two steps: modifying the php.ini configuration file and the 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 method. You need to modify the upload_max_filesize and post_max_size option values in the php.ini configuration file. For specific modification methods, please refer to: PHP.INI Configuration: File Upload Function Configuration Tutorial.
Step 2: Modify the PHP execution time and memory limit to implement the large file upload function of phpmyadmin
If you want phpmyadmin to upload large files, you also need to modify the three configuration options of max_execution_time (the maximum time for the PHP page to execute), max_input_time (the maximum time for the PHP page to accept data), and memory_limit (the maximum memory occupied by the PHP page) in the php.ini configuration file. , this is because when phpmyadmin uploads large files, the execution time and memory usage of the PHP page will inevitably become longer and larger, which requires the cooperation of the PHP operating environment. Simply modifying the upload file size limit is not enough.
Step 3: Modify the phpmyadmin configuration file
After completing the relevant configuration of php.ini, you also need to modify the phpmyadmin configuration.
1. Modify the $cfg['ExecTimeLimit'] configuration option in the phpmyadmin config configuration file. The default value is 300 and needs to be modified to 0, which means there is no time limit.
2. Modify $memory_limit in the import page under the phpmyadmin installation root directory
Note: It is preferred to read the memory configuration option memory_limit in the php.ini configuration file. If it is empty, the default memory size is limited to 2M. If there is no limit, the memory size is limited to 10M. You can combine it with the relevant settings in your php.ini configuration file. Information to modify this code.
At this point, after modifying the file upload configuration options in the php.ini configuration file and the phpmyadmin configuration file, the problem of phpmyadmin uploading file size restrictions can be solved, thereby realizing the phpmyadmin upload large file function.
Article source: http://www.leapsoul.cn/?p=1185 Please indicate the source link when reprinting.