Question

failed to open stream: Permission denied Severity: Warning

Posted November 30, 2017 2.7k views
MySQLPHPUbuntu 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.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
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.

Submit an Answer