The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Linux Permissions
FrostTaco
post Apr 28 2016, 03:38 PM
Post #1


Member
***

Group: Members
Posts: 47
Joined: 26-April 16
Member No.: 24,193



Hi guys, so i get this PHP error:
CODE
PHP Warning:  fopen(cache//afile.json): failed to open stream: Permission denied in /var/www/index.php on line 55

I know the chmod command, but don't know if thats what i need to use, and if i do need to use that, I don't know how to give my PHP permission. Any help is appreciated!
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
FrostTaco
post Apr 29 2016, 03:17 PM
Post #2


Member
***

Group: Members
Posts: 47
Joined: 26-April 16
Member No.: 24,193



Sorry for making this guys, just found the answer!
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Frederiek
post Apr 30 2016, 07:14 AM
Post #3


Programming Fanatic
********

Group: Members
Posts: 5,146
Joined: 23-August 06
From: Europe
Member No.: 9



Good.
It would be nice though if you could post your solution, so anyone with a similar problem can benefit from that.
That's a purpose of the forums too.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
imort
post Jun 18 2016, 07:35 AM
Post #4





Group: Members
Posts: 7
Joined: 18-June 16
Member No.: 24,338



QUOTE(FrostTaco @ Apr 29 2016, 02:38 AM) *

Hi guys, so i get this PHP error:
CODE
PHP Warning:  fopen(cache//afile.json): failed to open stream: Permission denied in /var/www/index.php on line 55

I know the chmod command, but don't know if thats what i need to use, and if i do need to use that, I don't know how to give my PHP permission. Any help is appreciated!


You need to make sure that your file '/cache/afile.json' have read permissions for apache process
Usually you can just run 'chmod a+r cache/afile.json' to make sure that everyone can read that file. Almost sure that apache doesn't need to change it.
You also can run 'chown www-data:www-data /var/www -R' to make sure that apache process have all rights on those files too.
It can be dangerous in the production environment but still good for the test or development server.

Take a look here to find more examples about Linux file permissions too.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 20th November 2017 - 10:15 AM