闲者博客 - POST https://bk1314.com/tag/POST/ zh-CN Thu, 03 Mar 2022 15:40:00 +0800 Thu, 03 Mar 2022 15:40:00 +0800 由于POST请求过大导致PHP7无法正常处理解决办法 https://bk1314.com/55.html https://bk1314.com/55.html Thu, 03 Mar 2022 15:40:00 +0800 飞鱼 概述

在巡检优化过程中,发现POST请求至PHP接口处理时,php服务无法读取到请求内容。
通过php.ini开启display_errors = Off后发现页面输出如下内容:

<br />
<b>Notice</b>: file_get_contents(): file created in the system's temporary directory in
<b>/var/www/html/api.php</b> on line <b>10</b><br />
<br />
<b>Warning</b>: file_get_contents(): Unable to create temporary file, Check permissions in temporary files directory. in
<b>/var/www/html/api.php</b> on line <b>10</b><br />

解决办法

由于sys_temp_dirupload_tmp_dir设置的临时目录不存在,mkdir后修改目录权限即可。

[scode type="share"]来源于:闲云博客[/scode]

]]>
0 https://bk1314.com/55.html#comments https://bk1314.com/feed/tag/POST/