Home  >  Article  >  Backend Development  >  php.ini惯用配置

php.ini惯用配置

WBOY
WBOYOriginal
2016-06-13 13:11:58698browse

php.ini常用配置

php.ini常用配置

1,语言配置

short_open_tag = Off ;果有某些程序使用了 ?>短标签,需要设置为on

2,错误提示

通常在开发环境 下,需要设置
display_errors = On ; 显示出错误信息
error_reporting = E_ALL; 显示所有的错误

(如果二次开发开源系统,可以设置为: error_reporting =E_ALL & ~E_NOTICE | E_STRICT; 屏蔽未初始化变量提示及旧版本php不建议使用提示)

?

发布环境

display_errors = off ; 不显示错误信息

(采用错误日志文件来分析问题:error_log="C:\Windows\temp\php-errors.log";错误日志文件设置)

3,资源限制

max_execution_time = 30 ;最长执行时间30秒 ,执行复杂文件操作时,需要修改时间为120

memory_limit = 128M? ;内存限制,如果有大容量文件需要解析,应该增大内存分配

4,数据处理

default_charset = "UTF-8 ";默认为iso-8859-1通常需要设置为UTF-8

?

5,文件上传

file_uploads = On ;是否允许文件上传
upload_max_filesize = 2M ;一次请求,最大上传文件容量,一般需要改成10M
max_file_uploads = 20 ;一次请求,最大上传文件个数
upload_tmp_dir="C:\Windows\Temp" ;文件上传临时目录

?

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn