VPS侦探论坛

 找回密码
 注册
查看: 1181|回复: 5

[Nginx] open() client_body_temp Permission denied

[复制链接]
发表于 2022-11-21 10:40:20 | 显示全部楼层 |阅读模式

nginx.conf 设置 user  www www;  权限不够 client_body_temp 无法上传图片,还要改哪里?client_body_temp 改 WWW.WWW 777 还是不行
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2022-11-21 11:34:04 | 显示全部楼层


./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-config-file-scan-dir=/usr/local/php/conf.d --with-mysql-sock=/tmp/mysql.sock --with-mhash --with-openssl --enable-mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --enable-gd --with-iconv --with-zlib --with-zip --enable-inline-optimization --disable-debug --disable-rpath --enable-shared --enable-xml --enable-bcmath --enable-shmop --enable-sysvsem --enable-sysvshm --enable-sysvmsg --enable-mbregex --enable-mbstring --enable-ftp --enable-intl --enable-pcntl --enable-sockets --with-xmlrpc --enable-soap --without-pear --with-gettext --with-xsl --enable-session --with-curl --with-jpeg --with-webp --with-freetype --enable-opcache --enable-fpm --with-fpm-user=www --with-fpm-group=www --without-gdbm --enable-fast-install --enable-exif --with-ldap --with-ldap-sasl --with-bz2 --with-sodium --with-imap --with-imap-ssl --with-kerberos 2>&1 | tee /root/php.log
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2022-11-21 11:34:15 | 显示全部楼层

./configure --prefix=/usr/local/nginx --user=www --group=www --with-threads --with-file-aio --with-http_ssl_module --with-http_v2_module --with-http_realip_module --with-http_addition_module --with-http_xslt_module --with-http_image_filter_module --with-http_geoip_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_auth_request_module --with-http_random_index_module --with-http_secure_link_module --with-http_degradation_module --with-http_slice_module --with-http_stub_status_module --with-stream --with-stream_ssl_module --with-stream_realip_module --with-stream_geoip_module --with-stream_ssl_preread_module --with-compat --with-pcre-jit 2>&1 | tee /root/nginx.log
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2022-11-21 20:38:14 | 显示全部楼层



lnmp的话默认 client_body_temp 应该是 /usr/local/nginx/client_body_temp/
chown www:www -R /usr/local/nginx/client_body_temp/
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2023-10-7 09:34:40 | 显示全部楼层

请教 @licess
已经设置了:chown www:www -R /usr/local/nginx/client_body_temp/
但就是无法生成临时文件,导致post表单时nginx报500
但如果用user root启动nginx,就可能正常缓存。
可能会是哪里的原因??
谢谢!

补充内容 (2023-10-7 09:35):
用user root启动nginx,就可以生成缓存。

军哥运维代购:http://shop63846532.taobao.com/

发表于 2023-10-7 10:02:35 | 显示全部楼层

谢谢 @licess,问题已经解决。将整个目录 /usr/local/nginx 给www后,问题得到解决。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-5-3 23:37 , Processed in 0.027606 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表