php script without permission in root document

Asked

Viewed 325 times

2

I would like to create a log with information from visitors to the page, but the script is not writable.

How to proceed?

PHP Warning: fopen(log.txt): failed to open stream: Permiss xc3 xa3o denied in /var/www/html/index.php on line 30

  • I had tried and tried again but without success.. PHP Warning: fopen(/home/user/Docs/webpage/log.txt): failed to open stream: Permiss xc3 xa3o negaa in /var/www/html/index.php on line 30

  • 1

    Try the following: open a terminal and navigate to the folder where the file is log.txt, then type: sudo chmod 777 log.txt, so you will change the access permissions to that file.

  • Thank you! @Qmechanic73 :)

  • I can post an answer?

1 answer

1


You may need to change the access permissions. Open a terminal and navigate to where the file is, and type:

sudo chmod 777 log.txt

This will allow you full access on that file. For more information on the use of chmod can be seen here.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.