Skip to main content

PHP file upload permission in linux

Normally while upload a file and move that file into web folder, will throw a error. Moving uploaded file will work fine in windows.

PHP Warning:  move_uploaded_file(upload/<<filename>>): failed to open stream: Permission denied in /var/www/<<project>>/some.php on line 21, referer: http://localhost/project/some.php

To solve above problem. change permission to 077 to that upload folder.

user@system:/var/www/project$ chmod 077 upload/



Comments