mac php上传图片500 错误
问题描述
brew 部署的php开发环境,后台上传图片遇到nginx500 错误
一开始怀疑php对上传图片的错误
开启php错误日志,上传图片,没记录错误日志
1.php错误日志排查
ini_set("display_errors","On");
error_reporting(E_ALL);
php.ini 设置php error_logs
2.排查nginx错误日志
zb@zbdeMacBook-Pro nginx % ls
access.log error.log
zb@zbdeMacBook-Pro nginx % pwd
/opt/homebrew/var/log/nginx
2021/03/04 15:14:35 [crit] 618#0: *333 open() "/opt/homebrew/var/run/nginx/client_body_temp/0000000055" failed (13: Permission denied), client: 127.0.0.1, server: local.lanen.com, request: "POST /admin.php/Product/editsave HTTP/1.1", host: "local.lanen.com", referrer: "http://local.lanen.com/admin.php/Product/edit"
- 找到client_body_temp 复制755 权限,不用重启nginx ,问题解决
相信坚持的力量,日复一日的习惯.