Linux上确认php.ini里memory_limit,post_max_size,upload_max_filesize配置确认

本文通过命令行展示了PHP的内存限制、POST最大尺寸及文件上传大小限制的配置详情,揭示了如何查看与调整这些参数以优化PHP应用性能。

[test@ip-125-125-125-125 ~]$  echo '<?php phpinfo(); ?>' | php 2>&1 |grep -i memory_limit
memory_limit => 128M => 128M
[test@ip-125-125-125-125 ~]$  echo '<?php phpinfo(); ?>' | php 2>&1 |grep -i post_max_size
post_max_size => 30M => 30M
[test@ip-125-125-125-125 ~]$  echo '<?php phpinfo(); ?>' | php 2>&1 |grep -i upload_max_filesize
upload_max_filesize => 15M => 15M

 

我在cpanel 多PHP编辑器只有这些 display_errors This determines whether errors should be printed to the screen as part of the output or if they should be hidden from the user. 已禁用 max_execution_time This sets the maximum time in seconds a script is allowed to run before it is terminated by the parser. This helps prevent poorly written scripts from tying up the server. The default setting is 30. 60 max_input_time This sets the maximum time in seconds a script is allowed to parse input data, like POST, GET and file uploads. 60 max_input_vars This sets the maximum number of input variables allowed per request and can be used to deter denial of service attacks involving hash collisions on the input variable names. 3000 memory_limit This sets the maximum amount of memory in bytes that a script is allowed to allocate. This helps prevent poorly written scripts for eating up all available memory on a server. Note that to have no memory limit, set this directive to -1. 6000M post_max_size Sets max size of post data allowed. This setting also affects file upload. To upload large files, this value must be larger than upload_max_filesize. Generally speaking, memory_limit should be larger than post_max_size. 1000M session.gc_maxlifetime This specifies the number of seconds after which data will be seen as "garbage" and potentially cleaned up. 1440 session.save_path session.save_path defines the argument which is passed to the save handler. If you choose the default files handler, this is the path where the files are created. /var/cpanel/php/sessions/ea-php74 upload_max_filesize The maximum size of an uploaded file. 1000M zlib.output_compression Whether to transparently compress pages. If this option is set to "On" in php.ini or the Apache configuration, pages are compressed if the browser sends an "Accept-Encoding: gzip" or "deflate" header. 已禁用
09-25
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

暮雨疏桐

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值