Home >Backend Development >PHP Tutorial > php 文件下传配置
php 文件上传配置
Apache+PHP环境上传大文件的相关配置选项
避免二次检索做无用功。
首先,需要根据允许上传的最大文件大小值(如32M),对php.ini中的如下参数进行配置:
file_uploads = On ; Whether to allow HTTP file uploads
upload_max_filesize = 32M ; Maximum allowed size for uploaded files
post_max_size = 32M ; Maximum size of POST data that PHP will accept
其中,各个参数的实际含义很明显,参考上述php.ini中的相关说明文字即可。
另外,实际中考虑到网络传输速度的影响,可能还需要对以下参数进行设置:
max_execution_time = 30000 ; Maximum execution time of each script, in seconds
max_input_time = 600 ; Maximum amount of time each script may spend parsing request data
memory_limit = 1024M ; Maximum amount of memory a script may consume