与文件上传有关的php配置参数总结

yipeiwu_com7年前PHP代码库
搞个了图片上传,死活不好使,后来发现是php参数配置的问题。
下面总结下与文件上传有关的php参数,备忘之~
所有这些参数都在php.ini中设置。

1.file_uploads
设为On,允许通过HTTP上传文件

2.upload_tmp_dir
文件上传至服务器时用于临时存储的目录,如果没指定,系统会使用默认的临时文件夹(我的机器是/tmp)。

3.upload_max_filesize
允许上传文件大小的最大值,默认为2M。

4.post_max_size
Php可接收的post数据的最大值(包括表单里的所有值的总合),默认为8M。

5.memory_limit
每个php所最占的最大内存数,这个值要大于允许上传的文件大小。

6.max_execution_time
每个php运行的最长时间(秒),默认30秒。

7.max_input_time
Php解析POST/GET数据的最长时间(秒),默认60秒。This sets the maximum time in seconds a scripts is allowed to parse input data, like POST and GET.It is measured from the mement of receiving all data on the server to the start of script execution.

相关文章

PHP中array_map与array_column之间的关系分析

本文以实例形式分析了PHP中array_map与array_column之间的关系,具体分析如下: array_map()与array_column()用法如下: array_map()...

PHP Primary script unknown 解决方法总结

相信很多配置php环境的都遇到过这个恼人的问题: 浏览器访问php文件,返回来 File not found 查看/var/log/nginx/error.log ,有 “Pr...

探讨方法的重写(覆载)详解

复制代码 代码如下:<?php class Cart{  public function Cart(){   echo...

探讨php define()函数及defined()函数使用详解

The define() function defines a constant.define()函数的作用是:定义一个常量。 Constants are much like varia...

php调用c接口无错版介绍

php调用c接口无错版介绍

1.首先是要安装好PHP2.进入PHP的下载解压目录下的ext目录#cd /root/php-5.3.6/ext#./ext_skel --extname=hmc说明:./ext_ske...