1

I am trying to set permission of folder on amozon ec2 server , but i am unable to set permission ,I am creating PDF file , and error comes , Unable to create output file. Then i found answer on this link

PHP TCPDF ERROR: Unable to create output file the folder exist and has the right permissions

chmod -R 0777 /yourdirectory

but when i used this command using putty , there is no output .I am unable to set permissions using putty , please help me out.Thanks in advance.

Community
  • 1
  • 1
  • *NIX operating systems does not output anything (by default) if the command has executed well. You should ```ls -l /yourdirectory``` and check that the ```yourdirectory``` has the ```drwxrwxrwx``` permission set (this is what the 0777 does). You should read about [file permission in unix like systems](http://en.wikipedia.org/wiki/File_system_permissions#Traditional_Unix_permissions) – mTorres Sep 03 '14 at 07:31
  • I tried it and found directory has drwxrwxrwx this permissions.So what to do next ? I simply need to create PDFs file in folder.After your answer I need to know , is I am facing other error then permissions. – Raza Ul Mustafa Sep 03 '14 at 08:07
  • The error you're facing now should be about permissions **if** you're using the right paths in your app (make sure that your PDF creation targets the ```yourdirectory``` path), as ```drwxrwxrwx``` makes the directory world writeable. Do you still have the same error? – mTorres Sep 03 '14 at 09:28
  • Thanks i solved it.Problem was with absolute path.I simply give direct path without using getcwd or document['root'] etc.... $pdf->Output('/var/www/html/scribeportaltest/uploads/documents/Patient_Report.pdf', 'F'); – Raza Ul Mustafa Sep 03 '14 at 10:19

1 Answers1

0

You can set the permissions with "chmod 777 path/". Is is right, that there is no output. There is only an ouput if an error occured.

jan
  • 142
  • 2
  • 2
  • 9
  • 0777 is not recommended because its dangerous for your system.. is any other permission for writing but restrict the anonymous user to write. – Arslan Maqbool Jul 01 '20 at 12:13