项目放到LNMP环境的服务器下,发现ueditor无法上传图片,最开始的问题是页面报“后端配置项没有正常加载,上传插件不能正常使用”。
当时Nginx的日志报的是:FastCGI sent in stderr: "Access to the script '/***/static/js/ueditor/php' has been denied (see security.limit_extensions)" while reading response header from upstream, client: ***, server: ***, request: "GET /static/js/ueditor/php/controller.php?action=config&&noCache=*** HTTP/1.1", upstream: "fastcgi://unix:/tmp/php-cgi.sock:", host: "***", referrer: "http://***/***.html"
百度过各种方法,包括修改ecurity.limit_extensions参数、Chongqing大小写问题、填写config.json绝对路径等等,均无变化。
后来重新修改了Nginx配置,在fastcgi.conf文件开头,添加以下
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
重启生效,ueditor正常出现“点击选择图片”按钮。