Introducing the method to break through the size limit of PHP upload files, including PHP file upload and phpmyadmin related configuration methods, friends in need can refer to it.
When phpmyadmin imports SQL files, it encounters an upload file size limit problem. The default phpmyadmin upload file size is 2M. If you want phpmyadmin to upload large files exceeding 2M, you need to modify the size configuration of the phpmyadmin upload file 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. To solve the problem of phpmyadmin upload file size limit, you need to modify 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 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 php.ini configuration file. There are three configuration options: 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). This is because when phpmyadmin uploads a large file, the execution time and memory usage of the PHP page It is bound to 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 phpmyadminconfig.inc.php 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: The MemoryLimit configuration here comes from phpmyadminconfig.inc.php, and the default is 0 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 limit is 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. |