Site icon moneyslow.com

PHP必配参数

现在很多网站都在使用着CMS,而目前大部分CMS都是PHP语言编写的。awspack也是用CMS WordPress搭建的,众所周知WordPress也是PHP语言编写的。
在这里简单介绍一下,安装PHP以后必须配置的几个参数。
date.timezone
安装PHP以后可以什么都不配,但是data.timezone这个参数是必须配的。
不然有可能报以下错误。
PHP Warning: phpinfo: It is not safe to rely on the system's timezone settings.
You are *required* to use the date.timezone setting or the date_default_timezone_set function.
In case you used any of those methods and you are still getting this warning,
you most likely misspelled the timezone identifier.
可以配Asia/Chongqing 或者 Asia/Shanghai。
date.timezone = "Asia/Chongqing"
memory_limit
限制一个PHP进程可用的内存容量,PHP5.3以后的默认值是128MB。一般来讲Web应用程序是根据每个请求启动不同的进程,因此不会耗费32MB以上的内存。但是如使用file_get_contents函数读取极大的文件及上传极大的文件时,因内存不足可能出现如下错误。
Fatal error:Allowed memory size of xxx bytes exhausted
php.ini里可以把memory_limit配置为32MB,而在上传极大文件的php里把内存限制解除。
php.ini
memory_limit = 32MB
php批处理文件

Exit mobile version