upload permission denied in DataTables Editor
upload permission denied in DataTables Editor
I am trying to implement the upload function and followed the online documentation. In the browser, after I attempt an upload, I see this:
A server error occurred while uploading the file
In the nginx error log, I see this:
*356 FastCGI sent in stderr: "PHP message: PHP Warning: move_uploaded_file(/var/www/public/client/upload/16.jpg): failed to open stream: Permission denied in /var/www/public/client/test1/associates/php/lib/Editor/Upload.php on line 457
PHP message: PHP Warning: move_uploaded_file(): Unable to move '/tmp/phpOkR4jq' to '/var/www/public/client/upload/16.jpg' in /var/www/public/client/test1/associates/php/lib/Editor/Upload.php on line 457" while reading response header from upstream, client: xxx, server: xxx, request: "POST /test1/associates/php/table.associates.php HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm/php-fpm.sock:", host: "xxx", referrer: "http://xxx/test1/associates/associates.php"
The permissions for /var/www/public/client/upload/ are 777 (also tried 755). The folder owner is nginx.
The upload entry is making it into my auxiliary SQL table, with the correct filename, file size, web_path and system_path.
Please help.
Thanks,
-John
Answers
The culprit was SELinux. Argh!!
I adjusted SELinux and uploads are working OK now.
I was able to run these commands to get SELinux to work in enforcing mode and allow DataTables the permissions to write to the upload directory:
I hope this helps some one else!
-John
Hi John,
Thanks for posting back - great to hear you've got it working now.
Regards,
Allan