一,配置错误日志
1,注意在生产环境中保持以下各项的默认值:
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
display_errors = Off
log_errors = On
说明:如果display_error = On
则会在页面上显示报错信息,
这在生产环境中是不允许的,如图:
所以不要修改生产环境中的display_errors = Off的值
2,指定error_log的路径
error_log = /web/logs/phplogs/php_errors.log
二,配置时区:
如果不指定,则php的默认时区可能会和本地不一致
[Date]
; Defines the default timezone used by the date functions
; https://php.net/date.timezone
;date.timezone =
date.timezone = Asia/Shanghai
三,指定资源的使用
文件上传时文件大小限制:
; upload_max_filesize = 2M
upload_max_filesize = 32M
单次post的最大数据量:
;post_max_size = 8M
post_max_size = 64M
说明:刘宏缔的架构森林是一个专注架构的博客,地址:https://www.cnblogs.com/architectforest
对应的源码可以访问这里获取: https://github.com/liuhongdi/
或: https://gitee.com/liuhongdi
说明:作者:刘宏缔 邮箱: [email protected]
四,查看php的版本:
[root@img daemon]# /usr/local/soft/php8.2.5/bin/php --version
PHP 8.2.5 (cli) (built: May 10 2023 14:51:39) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.5, Copyright (c) Zend Technologies
标签:8.2,log,errors,ini,https,php,com,PHP
From: https://www.cnblogs.com/architectforest/p/17391252.html