闲者博客 - POST https://bk1314.com/tag/POST/ 由于POST请求过大导致PHP7无法正常处理解决办法 https://bk1314.com/55.html 2022-03-03T15:40:00+08:00 概述在巡检优化过程中,发现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_dir和upload_tmp_dir设置的临时目录不存在,mkdir后修改目录权限即可。[scode type="share"]来源于:闲云博客[/scode]