failed to open stream: Permission denied Severity: Warning

November 30, 2017 1.7k views
PHP MySQL Ubuntu 16.04

When i trying to upload a file in registration form am getting below error.

<p>Severity: Warning</p>
<p>Message: moveuploadedfile(./assets/uploads/textresumes/2319Test_Resume.docx): failed to open stream: Permission denied</p>

<p>Severity: Warning</p>
<p>Message: moveuploadedfile(): Unable to move ’/tmp/phpangslr’ to ’./assets/uploads/textresumes/2319Test_Resume.docx’</p>

Am working in PHP Codeigniter web application , please tell me solution for this problem.

3 Answers

Use chmod and/or chown so your PHP user is allowed to write to that directory.

can you please tell me the command ?

We don’t know your setup and so won’t bother with guessing. The web server on your machine must have permissions to write to the target folders. What you’re trying to do is security sensitive and I highly recommend you take the time to understand how permissions and file uploads work before you try to configure it.

Have another answer? Share your knowledge.